@oguzhan18/angular-jest

ALWAYS use when testing Angular applications with Jest, configuring Jest, or migrating from Jasmine/Karma to Jest.

View in AI SkillSafe app
Scanned · no findings
0 downloads
0 stars
0 demos
SKILL.md
nameangular-jest
descriptionALWAYS use when testing Angular applications with Jest, configuring Jest, or migrating from Jasmine/Karma to Jest.

Angular + Jest

Version: Jest 29.x (2025) Tags: Jest, Testing, Unit Tests

References: Jestjest-preset-angular

Best Practices

  • Install Jest
npm install --save-dev jest @types/jest jest-preset-angular
  • Configure Jest
// jest.config.js
module.exports = {
  preset: 'jest-preset-angular',
  setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
  testPathIgnorePatterns: ['<rootDir>/node_modules/'],
};
  • Write test
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MyComponent } from './my.component';

describe('MyComponent', () => {
  let component: MyComponent;
  let fixture: ComponentFixture<MyComponent>;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [MyComponent]
    }).compileComponents();

    fixture = TestBed.createComponent(MyComponent);
    component = fixture.componentInstance;
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});

Embed badges

Add these to your README to show the skill's verification status.

SkillSafe verified badge
Verified badge
[![SkillSafe verified badge](https://api.skillsafe.ai/v1/badge/@oguzhan18/angular-jest/verified)](https://skillsafe.ai/skill/@oguzhan18/angular-jest/)
Installs badge
Installs badge
[![Installs badge](https://api.skillsafe.ai/v1/badge/@oguzhan18/angular-jest/installs)](https://skillsafe.ai/skill/@oguzhan18/angular-jest/)
Scan badge
Scan badge
[![Scan badge](https://api.skillsafe.ai/v1/badge/@oguzhan18/angular-jest/scan)](https://skillsafe.ai/skill/@oguzhan18/angular-jest/)
Eval pass rate badge
Eval pass rate
[![Eval pass rate badge](https://api.skillsafe.ai/v1/badge/@oguzhan18/angular-jest/eval)](https://skillsafe.ai/skill/@oguzhan18/angular-jest/)