angular-jest

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

oguzhan18/angular-ecosystem-skills181 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: angular-jest
description: ALWAYS use when testing Angular applications with Jest, configuring Jest, or migrating from Jasmine/Karma to Jest.
license: MIT
---

# Angular + Jest

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

**References:** [Jest](https://jestjs.io/) • [jest-preset-angular](https://github.com/thymikee/jest-preset-angular)

## Best Practices

- Install Jest

```bash
npm install --save-dev jest @types/jest jest-preset-angular
```

- Configure Jest

```js
// jest.config.js
module.exports = {
  preset: 'jest-preset-angular',
  setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
  testPathIgnorePatterns: ['<rootDir>/node_modules/'],
};
```

- Write test

```ts
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();
  });
});
```

More Testing skills

← All Testing skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY