Testing

From andresdiegolanda/design-first-ai · View interactive version

Testing is an AI agent skill from the GitHub repository andresdiegolanda/design-first-ai. Jasmine and TestBed patterns for Angular components. Use when writing any new test or adding coverage.

How to use this skill

Skill file

Skill: Testing Angular Components (angular-user-search)

Setup pattern

let userServiceSpy: jasmine.SpyObj<UserService>;

beforeEach(async () => {
  userServiceSpy = jasmine.createSpyObj('UserService', ['getUsers']);
  await TestBed.configureTestingModule({
    imports: [UserSearchComponent, ReactiveFormsModule],
    providers: [{ provide: UserService, useValue: userServiceSpy }]
  }).compileComponents();
});

Rules

Test naming

method_condition_expectedResult

Design Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.