mcpField
A
angular-jest

angular-jest

github.com/oguzhan18Testing & quality7190 installsUpdated 30w ago
Repository

About angular-jest

A testing skill for Angular projects using Jest and jest-preset-angular. It covers Jest setup and component unit-test patterns.

Key features

  1. 01Install Jest testing dependencies
  2. 02Configure jest-preset-angular
  3. 03Write component unit tests

Use cases

  1. 01Set up Jest in an Angular project
  2. 02Test Angular components with TestBed

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oguzhan18/angular-ecosystem-skills --skill angular-jest

After installing, type/angular-jestin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/discussions/
_INDEX.md
references/docs/
_INDEX.md
references/issues/
_INDEX.md
references/releases/
_INDEX.md

Details

From the project README

Angular + Jest

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

References: Jest • jest-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();
  });
});

Comments

Markdown supported