[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78VAF1KNJPC997C6QS2013P":3,"skill-same:01M78VAF1KNJPC997C6QS2013P":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":14,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M78VAF1KNJPC997C6QS2013P","angular-testing",null,"Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns. Use for testing components with signals, OnPush change detection, services with inject(), and HTTP interactions. Triggers on test creation, testing signal-based components, mocking dependencies, or setting up test infrastructure. Don't use for E2E testing with Cypress or Playwright, or for testing non-Angular JavaScript\u002FTypeScript code.","mfrancime\u002Ftrident-archive","mfrancime","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F577553?v=4","01M75NH5W71WGY7NTS8YQ6VP8G","verzillion_kram","01M75NH5WTX2HBXJZWRP4DGAPK",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-testing\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: angular-testing\ndescription: >-\n  Write unit and integration tests for Angular v20+ applications using Vitest or\n  Jasmine with TestBed and modern testing patterns. Use for testing components\n  with signals, OnPush change detection, services with inject(), and HTTP\n  interactions. Triggers on test creation, testing signal-based components,\n  mocking dependencies, or setting up test infrastructure. Don't use for E2E\n  testing with Cypress or Playwright, or for testing non-Angular\n  JavaScript\u002FTypeScript code.\nmetadata:\n  category: development\n  source:\n    repository: 'https:\u002F\u002Fgithub.com\u002Fanalogjs\u002Fangular-skills'\n    path: skills\u002Fangular-testing\n    license_path: LICENSE\n---\n\n# Angular Testing\n\nTest Angular v20+ applications with Vitest (recommended) or Jasmine, focusing on signal-based components and modern patterns.\n\n## Vitest Setup (Angular v20+)\n\nAngular v20+ has native Vitest support through the `@angular\u002Fbuild` package.\n\n```bash\nnpm install -D vitest jsdom\n```\n\nConfigure in angular.json:\n\n```json\n{\n  \"projects\": {\n    \"your-app\": {\n      \"architect\": {\n        \"test\": {\n          \"builder\": \"@angular\u002Fbuild:unit-test\",\n          \"options\": {\n            \"tsConfig\": \"tsconfig.spec.json\",\n            \"buildTarget\": \"your-app:build\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nRun tests:\n\n```bash\nng test              # Run tests\nng test --watch      # Watch mode\nng test --code-coverage  # With coverage\n```\n\nFor Vitest migration from Jasmine and advanced configuration, see [references\u002Fvitest-migration.md](references\u002Fvitest-migration.md).\n\n## Basic Component Test\n\n```typescript\nimport { describe, it, expect, beforeEach } from 'vitest';\nimport { ComponentFixture, TestBed } from '@angular\u002Fcore\u002Ftesting';\nimport { Counter } from '.\u002Fcounter.component';\n\ndescribe('Counter', () => {\n  let component: Counter;\n  let fixture: ComponentFixture\u003CCounter>;\n  \n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [Counter], \u002F\u002F Standalone component\n    }).compileComponents();\n    \n    fixture = TestBed.createComponent(Counter);\n    component = fixture.componentInstance;\n    fixture.detectChanges();\n  });\n  \n  it('should create', () => {\n    expect(component).toBeTruthy();\n  });\n  \n  it('should increment count', () => {\n    expect(component.count()).toBe(0);\n    component.increment();\n    expect(component.count()).toBe(1);\n  });\n  \n  it('should display count in template', () => {\n    component.count.set(5);\n    fixture.detectChanges();\n    \n    const element = fixture.nativeElement.querySelector('.count');\n    expect(element.textContent).toContain('5');\n  });\n});\n```\n\n## Testing Signals\n\n### Direct Signal Testing\n\n```typescript\nimport { signal, computed } from '@angular\u002Fcore';\n\ndescribe('Signal logic', () => {\n  it('should update computed when signal changes', () => {\n    const count = signal(0);\n    const doubled = computed(() => count() * 2);\n    \n    expect(doubled()).toBe(0);\n    \n    count.set(5);\n    expect(doubled()).toBe(10);\n    \n    count.update(c => c + 1);\n    expect(doubled()).toBe(12);\n  });\n});\n```\n\n### Testing Component Signals\n\n```typescript\n@Component({\n  selector: 'app-todo-list',\n  template: `\n    \u003Cul>\n      @for (todo of filteredTodos(); track todo.id) {\n        \u003Cli>{{ todo.text }}\u003C\u002Fli>\n      }\n    \u003C\u002Ful>\n    \u003Cp>{{ remaining() }} remaining\u003C\u002Fp>\n  `,\n})\nexport class TodoList {\n  todos = signal\u003CTodo[]>([]);\n  filter = signal\u003C'all' | 'active' | 'done'>('all');\n  \n  filteredTodos = computed(() => {\n    const todos = this.todos();\n    switch (this.filter()) {\n      case 'active': return todos.filter(t => !t.done);\n      case 'done': return todos.filter(t => t.done);\n      default: return todos;\n    }\n  });\n  \n  remaining = computed(() => this.todos().filter(t => !t.done).length);\n}\n\ndescribe('TodoList', () => {\n  let component: TodoList;\n  let fixture: ComponentFixture\u003CTodoList>;\n  \n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [TodoList],\n    }).compileComponents();\n    \n    fixture = TestBed.createComponent(TodoList);\n    component = fixture.componentInstance;\n  });\n  \n  it('should filter active todos', () => {\n    component.todos.set([\n      { id: '1', text: 'Task 1', done: false },\n      { id: '2', text: 'Task 2', done: true },\n      { id: '3', text: 'Task 3', done: false },\n    ]);\n    \n    component.filter.set('active');\n    \n    expect(component.filteredTodos().length).toBe(2);\n    expect(component.remaining()).toBe(2);\n  });\n});\n```\n\n## Testing OnPush Components\n\nOnPush components require explicit change detection:\n\n```typescript\n@Component({\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: `\u003Cspan>{{ data().name }}\u003C\u002Fspan>`,\n})\nexport class OnPushCmpt {\n  data = input.required\u003C{ name: string }>();\n}\n\ndescribe('OnPushCmpt', () => {\n  it('should update when input signal changes', () => {\n    const fixture = TestBed.createComponent(OnPushCmpt);\n    \n    \u002F\u002F Set input using setInput (for signal inputs)\n    fixture.componentRef.setInput('data', { name: 'Initial' });\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('Initial');\n    \n    \u002F\u002F Update input\n    fixture.componentRef.setInput('data', { name: 'Updated' });\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('Updated');\n  });\n});\n```\n\n## Testing Services\n\n### Basic Service Test\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class CounterService {\n  private _count = signal(0);\n  readonly count = this._count.asReadonly();\n  \n  increment() { this._count.update(c => c + 1); }\n  reset() { this._count.set(0); }\n}\n\ndescribe('CounterService', () => {\n  let service: CounterService;\n  \n  beforeEach(() => {\n    TestBed.configureTestingModule({});\n    service = TestBed.inject(CounterService);\n  });\n  \n  it('should increment count', () => {\n    expect(service.count()).toBe(0);\n    service.increment();\n    expect(service.count()).toBe(1);\n  });\n});\n```\n\n### Service with HTTP\n\n```typescript\nimport { HttpTestingController, provideHttpClientTesting } from '@angular\u002Fcommon\u002Fhttp\u002Ftesting';\nimport { provideHttpClient } from '@angular\u002Fcommon\u002Fhttp';\n\ndescribe('UserService', () => {\n  let service: UserService;\n  let httpMock: HttpTestingController;\n  \n  beforeEach(() => {\n    TestBed.configureTestingModule({\n      providers: [\n        provideHttpClient(),\n        provideHttpClientTesting(),\n      ],\n    });\n    \n    service = TestBed.inject(UserService);\n    httpMock = TestBed.inject(HttpTestingController);\n  });\n  \n  afterEach(() => {\n    httpMock.verify(); \u002F\u002F Verify no outstanding requests\n  });\n  \n  it('should fetch user by id', () => {\n    const mockUser = { id: '1', name: 'Test User' };\n    \n    service.getUser('1').subscribe(user => {\n      expect(user).toEqual(mockUser);\n    });\n    \n    const req = httpMock.expectOne('\u002Fapi\u002Fusers\u002F1');\n    expect(req.request.method).toBe('GET');\n    req.flush(mockUser);\n  });\n});\n```\n\n## Mocking Dependencies\n\n### Using Vitest Mocks\n\n```typescript\nimport { describe, it, expect, vi, beforeEach } from 'vitest';\n\ndescribe('UserProfile', () => {\n  const mockUserService = {\n    getUser: vi.fn(),\n    updateUser: vi.fn(),\n    user: signal\u003CUser | null>(null),\n  };\n  \n  beforeEach(async () => {\n    vi.clearAllMocks();\n    mockUserService.getUser.mockReturnValue(of({ id: '1', name: 'Test' }));\n    \n    await TestBed.configureTestingModule({\n      imports: [UserProfile],\n      providers: [\n        { provide: UserService, useValue: mockUserService },\n      ],\n    }).compileComponents();\n  });\n  \n  it('should call getUser on init', () => {\n    const fixture = TestBed.createComponent(UserProfile);\n    fixture.detectChanges();\n    \n    expect(mockUserService.getUser).toHaveBeenCalledWith('1');\n  });\n});\n```\n\n### Mock Signal-Based Service\n\n```typescript\nconst mockAuth = {\n  user: signal\u003CUser | null>(null),\n  isAuthenticated: computed(() => mockAuth.user() !== null),\n  login: vi.fn(),\n  logout: vi.fn(),\n};\n\nbeforeEach(async () => {\n  await TestBed.configureTestingModule({\n    imports: [ProtectedPage],\n    providers: [\n      { provide: AuthService, useValue: mockAuth },\n    ],\n  }).compileComponents();\n});\n\nit('should show content when authenticated', () => {\n  mockAuth.user.set({ id: '1', name: 'Test User' });\n  \n  const fixture = TestBed.createComponent(ProtectedPage);\n  fixture.detectChanges();\n  \n  expect(fixture.nativeElement.querySelector('.protected-content')).toBeTruthy();\n});\n```\n\n## Testing Inputs and Outputs\n\n```typescript\n@Component({\n  selector: 'app-item',\n  template: `\u003Cdiv (click)=\"select()\">{{ item().name }}\u003C\u002Fdiv>`,\n})\nexport class ItemCmpt {\n  item = input.required\u003CItem>();\n  selected = output\u003CItem>();\n  \n  select() {\n    this.selected.emit(this.item());\n  }\n}\n\ndescribe('ItemCmpt', () => {\n  it('should emit selected event on click', () => {\n    const fixture = TestBed.createComponent(ItemCmpt);\n    const item: Item = { id: '1', name: 'Test Item' };\n    \n    fixture.componentRef.setInput('item', item);\n    fixture.detectChanges();\n    \n    let emittedItem: Item | undefined;\n    fixture.componentInstance.selected.subscribe(i => emittedItem = i);\n    \n    fixture.nativeElement.querySelector('div').click();\n    \n    expect(emittedItem).toEqual(item);\n  });\n});\n```\n\n## Testing Async Operations\n\n### Using fakeAsync\n\n```typescript\nimport { fakeAsync, tick, flush } from '@angular\u002Fcore\u002Ftesting';\n\nit('should debounce search', fakeAsync(() => {\n  const fixture = TestBed.createComponent(SearchCmpt);\n  fixture.detectChanges();\n  \n  fixture.componentInstance.query.set('test');\n  \n  tick(300); \u002F\u002F Advance time for debounce\n  fixture.detectChanges();\n  \n  expect(fixture.componentInstance.results().length).toBeGreaterThan(0);\n  \n  flush(); \u002F\u002F Flush remaining timers\n}));\n```\n\n### Using waitForAsync\n\n```typescript\nimport { waitForAsync } from '@angular\u002Fcore\u002Ftesting';\n\nit('should load data', waitForAsync(() => {\n  const fixture = TestBed.createComponent(DataCmpt);\n  fixture.detectChanges();\n  \n  fixture.whenStable().then(() => {\n    fixture.detectChanges();\n    expect(fixture.componentInstance.data()).toBeDefined();\n  });\n}));\n```\n\n## Testing HTTP Resources\n\n```typescript\n@Component({\n  template: `\n    @if (userResource.isLoading()) {\n      \u003Cp>Loading...\u003C\u002Fp>\n    } @else if (userResource.hasValue()) {\n      \u003Cp>{{ userResource.value().name }}\u003C\u002Fp>\n    }\n  `,\n})\nexport class UserCmpt {\n  userId = signal('1');\n  userResource = httpResource\u003CUser>(() => `\u002Fapi\u002Fusers\u002F${this.userId()}`);\n}\n\ndescribe('UserCmpt', () => {\n  let httpMock: HttpTestingController;\n  \n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [UserCmpt],\n      providers: [\n        provideHttpClient(),\n        provideHttpClientTesting(),\n      ],\n    }).compileComponents();\n    \n    httpMock = TestBed.inject(HttpTestingController);\n  });\n  \n  it('should display user name after loading', () => {\n    const fixture = TestBed.createComponent(UserCmpt);\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('Loading');\n    \n    const req = httpMock.expectOne('\u002Fapi\u002Fusers\u002F1');\n    req.flush({ id: '1', name: 'John Doe' });\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('John Doe');\n  });\n});\n```\n\nFor advanced testing patterns including component harnesses, router testing, form testing, and directive testing, see [references\u002Ftesting-patterns.md](references\u002Ftesting-patterns.md).\n\nFor Vitest migration from Jasmine, see [references\u002Fvitest-migration.md](references\u002Fvitest-migration.md).\n","# Angular Testing\n\nTest Angular v20+ applications with Vitest (recommended) or Jasmine, focusing on signal-based components and modern patterns.\n\n## Vitest Setup (Angular v20+)\n\nAngular v20+ has native Vitest support through the `@angular\u002Fbuild` package.\n\n```bash\nnpm install -D vitest jsdom\n```\n\nConfigure in angular.json:\n\n```json\n{\n  \"projects\": {\n    \"your-app\": {\n      \"architect\": {\n        \"test\": {\n          \"builder\": \"@angular\u002Fbuild:unit-test\",\n          \"options\": {\n            \"tsConfig\": \"tsconfig.spec.json\",\n            \"buildTarget\": \"your-app:build\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nRun tests:\n\n```bash\nng test              # Run tests\nng test --watch      # Watch mode\nng test --code-coverage  # With coverage\n```\n\nFor Vitest migration from Jasmine and advanced configuration, see [references\u002Fvitest-migration.md](references\u002Fvitest-migration.md).\n\n## Basic Component Test\n\n```typescript\nimport { describe, it, expect, beforeEach } from 'vitest';\nimport { ComponentFixture, TestBed } from '@angular\u002Fcore\u002Ftesting';\nimport { Counter } from '.\u002Fcounter.component';\n\ndescribe('Counter', () => {\n  let component: Counter;\n  let fixture: ComponentFixture\u003CCounter>;\n  \n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [Counter], \u002F\u002F Standalone component\n    }).compileComponents();\n    \n    fixture = TestBed.createComponent(Counter);\n    component = fixture.componentInstance;\n    fixture.detectChanges();\n  });\n  \n  it('should create', () => {\n    expect(component).toBeTruthy();\n  });\n  \n  it('should increment count', () => {\n    expect(component.count()).toBe(0);\n    component.increment();\n    expect(component.count()).toBe(1);\n  });\n  \n  it('should display count in template', () => {\n    component.count.set(5);\n    fixture.detectChanges();\n    \n    const element = fixture.nativeElement.querySelector('.count');\n    expect(element.textContent).toContain('5');\n  });\n});\n```\n\n## Testing Signals\n\n### Direct Signal Testing\n\n```typescript\nimport { signal, computed } from '@angular\u002Fcore';\n\ndescribe('Signal logic', () => {\n  it('should update computed when signal changes', () => {\n    const count = signal(0);\n    const doubled = computed(() => count() * 2);\n    \n    expect(doubled()).toBe(0);\n    \n    count.set(5);\n    expect(doubled()).toBe(10);\n    \n    count.update(c => c + 1);\n    expect(doubled()).toBe(12);\n  });\n});\n```\n\n### Testing Component Signals\n\n```typescript\n@Component({\n  selector: 'app-todo-list',\n  template: `\n    \u003Cul>\n      @for (todo of filteredTodos(); track todo.id) {\n        \u003Cli>{{ todo.text }}\u003C\u002Fli>\n      }\n    \u003C\u002Ful>\n    \u003Cp>{{ remaining() }} remaining\u003C\u002Fp>\n  `,\n})\nexport class TodoList {\n  todos = signal\u003CTodo[]>([]);\n  filter = signal\u003C'all' | 'active' | 'done'>('all');\n  \n  filteredTodos = computed(() => {\n    const todos = this.todos();\n    switch (this.filter()) {\n      case 'active': return todos.filter(t => !t.done);\n      case 'done': return todos.filter(t => t.done);\n      default: return todos;\n    }\n  });\n  \n  remaining = computed(() => this.todos().filter(t => !t.done).length);\n}\n\ndescribe('TodoList', () => {\n  let component: TodoList;\n  let fixture: ComponentFixture\u003CTodoList>;\n  \n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [TodoList],\n    }).compileComponents();\n    \n    fixture = TestBed.createComponent(TodoList);\n    component = fixture.componentInstance;\n  });\n  \n  it('should filter active todos', () => {\n    component.todos.set([\n      { id: '1', text: 'Task 1', done: false },\n      { id: '2', text: 'Task 2', done: true },\n      { id: '3', text: 'Task 3', done: false },\n    ]);\n    \n    component.filter.set('active');\n    \n    expect(component.filteredTodos().length).toBe(2);\n    expect(component.remaining()).toBe(2);\n  });\n});\n```\n\n## Testing OnPush Components\n\nOnPush components require explicit change detection:\n\n```typescript\n@Component({\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: `\u003Cspan>{{ data().name }}\u003C\u002Fspan>`,\n})\nexport class OnPushCmpt {\n  data = input.required\u003C{ name: string }>();\n}\n\ndescribe('OnPushCmpt', () => {\n  it('should update when input signal changes', () => {\n    const fixture = TestBed.createComponent(OnPushCmpt);\n    \n    \u002F\u002F Set input using setInput (for signal inputs)\n    fixture.componentRef.setInput('data', { name: 'Initial' });\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('Initial');\n    \n    \u002F\u002F Update input\n    fixture.componentRef.setInput('data', { name: 'Updated' });\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('Updated');\n  });\n});\n```\n\n## Testing Services\n\n### Basic Service Test\n\n```typescript\n@Injectable({ providedIn: 'root' })\nexport class CounterService {\n  private _count = signal(0);\n  readonly count = this._count.asReadonly();\n  \n  increment() { this._count.update(c => c + 1); }\n  reset() { this._count.set(0); }\n}\n\ndescribe('CounterService', () => {\n  let service: CounterService;\n  \n  beforeEach(() => {\n    TestBed.configureTestingModule({});\n    service = TestBed.inject(CounterService);\n  });\n  \n  it('should increment count', () => {\n    expect(service.count()).toBe(0);\n    service.increment();\n    expect(service.count()).toBe(1);\n  });\n});\n```\n\n### Service with HTTP\n\n```typescript\nimport { HttpTestingController, provideHttpClientTesting } from '@angular\u002Fcommon\u002Fhttp\u002Ftesting';\nimport { provideHttpClient } from '@angular\u002Fcommon\u002Fhttp';\n\ndescribe('UserService', () => {\n  let service: UserService;\n  let httpMock: HttpTestingController;\n  \n  beforeEach(() => {\n    TestBed.configureTestingModule({\n      providers: [\n        provideHttpClient(),\n        provideHttpClientTesting(),\n      ],\n    });\n    \n    service = TestBed.inject(UserService);\n    httpMock = TestBed.inject(HttpTestingController);\n  });\n  \n  afterEach(() => {\n    httpMock.verify(); \u002F\u002F Verify no outstanding requests\n  });\n  \n  it('should fetch user by id', () => {\n    const mockUser = { id: '1', name: 'Test User' };\n    \n    service.getUser('1').subscribe(user => {\n      expect(user).toEqual(mockUser);\n    });\n    \n    const req = httpMock.expectOne('\u002Fapi\u002Fusers\u002F1');\n    expect(req.request.method).toBe('GET');\n    req.flush(mockUser);\n  });\n});\n```\n\n## Mocking Dependencies\n\n### Using Vitest Mocks\n\n```typescript\nimport { describe, it, expect, vi, beforeEach } from 'vitest';\n\ndescribe('UserProfile', () => {\n  const mockUserService = {\n    getUser: vi.fn(),\n    updateUser: vi.fn(),\n    user: signal\u003CUser | null>(null),\n  };\n  \n  beforeEach(async () => {\n    vi.clearAllMocks();\n    mockUserService.getUser.mockReturnValue(of({ id: '1', name: 'Test' }));\n    \n    await TestBed.configureTestingModule({\n      imports: [UserProfile],\n      providers: [\n        { provide: UserService, useValue: mockUserService },\n      ],\n    }).compileComponents();\n  });\n  \n  it('should call getUser on init', () => {\n    const fixture = TestBed.createComponent(UserProfile);\n    fixture.detectChanges();\n    \n    expect(mockUserService.getUser).toHaveBeenCalledWith('1');\n  });\n});\n```\n\n### Mock Signal-Based Service\n\n```typescript\nconst mockAuth = {\n  user: signal\u003CUser | null>(null),\n  isAuthenticated: computed(() => mockAuth.user() !== null),\n  login: vi.fn(),\n  logout: vi.fn(),\n};\n\nbeforeEach(async () => {\n  await TestBed.configureTestingModule({\n    imports: [ProtectedPage],\n    providers: [\n      { provide: AuthService, useValue: mockAuth },\n    ],\n  }).compileComponents();\n});\n\nit('should show content when authenticated', () => {\n  mockAuth.user.set({ id: '1', name: 'Test User' });\n  \n  const fixture = TestBed.createComponent(ProtectedPage);\n  fixture.detectChanges();\n  \n  expect(fixture.nativeElement.querySelector('.protected-content')).toBeTruthy();\n});\n```\n\n## Testing Inputs and Outputs\n\n```typescript\n@Component({\n  selector: 'app-item',\n  template: `\u003Cdiv (click)=\"select()\">{{ item().name }}\u003C\u002Fdiv>`,\n})\nexport class ItemCmpt {\n  item = input.required\u003CItem>();\n  selected = output\u003CItem>();\n  \n  select() {\n    this.selected.emit(this.item());\n  }\n}\n\ndescribe('ItemCmpt', () => {\n  it('should emit selected event on click', () => {\n    const fixture = TestBed.createComponent(ItemCmpt);\n    const item: Item = { id: '1', name: 'Test Item' };\n    \n    fixture.componentRef.setInput('item', item);\n    fixture.detectChanges();\n    \n    let emittedItem: Item | undefined;\n    fixture.componentInstance.selected.subscribe(i => emittedItem = i);\n    \n    fixture.nativeElement.querySelector('div').click();\n    \n    expect(emittedItem).toEqual(item);\n  });\n});\n```\n\n## Testing Async Operations\n\n### Using fakeAsync\n\n```typescript\nimport { fakeAsync, tick, flush } from '@angular\u002Fcore\u002Ftesting';\n\nit('should debounce search', fakeAsync(() => {\n  const fixture = TestBed.createComponent(SearchCmpt);\n  fixture.detectChanges();\n  \n  fixture.componentInstance.query.set('test');\n  \n  tick(300); \u002F\u002F Advance time for debounce\n  fixture.detectChanges();\n  \n  expect(fixture.componentInstance.results().length).toBeGreaterThan(0);\n  \n  flush(); \u002F\u002F Flush remaining timers\n}));\n```\n\n### Using waitForAsync\n\n```typescript\nimport { waitForAsync } from '@angular\u002Fcore\u002Ftesting';\n\nit('should load data', waitForAsync(() => {\n  const fixture = TestBed.createComponent(DataCmpt);\n  fixture.detectChanges();\n  \n  fixture.whenStable().then(() => {\n    fixture.detectChanges();\n    expect(fixture.componentInstance.data()).toBeDefined();\n  });\n}));\n```\n\n## Testing HTTP Resources\n\n```typescript\n@Component({\n  template: `\n    @if (userResource.isLoading()) {\n      \u003Cp>Loading...\u003C\u002Fp>\n    } @else if (userResource.hasValue()) {\n      \u003Cp>{{ userResource.value().name }}\u003C\u002Fp>\n    }\n  `,\n})\nexport class UserCmpt {\n  userId = signal('1');\n  userResource = httpResource\u003CUser>(() => `\u002Fapi\u002Fusers\u002F${this.userId()}`);\n}\n\ndescribe('UserCmpt', () => {\n  let httpMock: HttpTestingController;\n  \n  beforeEach(async () => {\n    await TestBed.configureTestingModule({\n      imports: [UserCmpt],\n      providers: [\n        provideHttpClient(),\n        provideHttpClientTesting(),\n      ],\n    }).compileComponents();\n    \n    httpMock = TestBed.inject(HttpTestingController);\n  });\n  \n  it('should display user name after loading', () => {\n    const fixture = TestBed.createComponent(UserCmpt);\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('Loading');\n    \n    const req = httpMock.expectOne('\u002Fapi\u002Fusers\u002F1');\n    req.flush({ id: '1', name: 'John Doe' });\n    fixture.detectChanges();\n    \n    expect(fixture.nativeElement.textContent).toContain('John Doe');\n  });\n});\n```\n\nFor advanced testing patterns including component harnesses, router testing, form testing, and directive testing, see [references\u002Ftesting-patterns.md](references\u002Ftesting-patterns.md).\n\nFor Vitest migration from Jasmine, see [references\u002Fvitest-migration.md](references\u002Fvitest-migration.md).\n",{"name":5,"metadata":25,"description":7},{"source":26,"category":30},{"path":27,"repository":28,"license_path":29},"skills\u002Fangular-testing","https:\u002F\u002Fgithub.com\u002Fanalogjs\u002Fangular-skills","LICENSE","development","main","cef85894d3d9a4c9dabe5a90887d5ac59fe4ff0f","repos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-testing","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive","https:\u002F\u002Fgithub.com\u002Fmfrancime","2026-09-11 19:19:01",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add mfrancime\u002Ftrident-archive --skill angular-testing",{"tool":43,"command":44},"bunx","bunx skills add mfrancime\u002Ftrident-archive --skill angular-testing",{"tool":46,"command":47},"pnpm","pnpm dlx skills add mfrancime\u002Ftrident-archive --skill angular-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-testing\u002FSKILL.md",true,[51,54,60],{"path":29,"resourceType":29,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":16},"许可证",1072,{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Ftesting-patterns.md","REFERENCE","参考文档",17051,"https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-testing\u002Freferences\u002Ftesting-patterns.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fvitest-migration.md",3121,"https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-testing\u002Freferences\u002Fvitest-migration.md",[65,74,82,90,97,104],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":69,"licenseFileUrl":70,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":20},"01M78VKWV0YXDY47JW2S4M19R1","skill-creator","Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fskills\u002Fskill-creator\u002Flicense.txt","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fskills\u002Fskill-creator\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":20},"01M78VGSK0VQR8DFB181VS4MN8","prose","OpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fextensions\u002Fopen-prose\u002Fskills\u002Fprose\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fextensions\u002Fopen-prose\u002Fskills\u002Fprose\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":69,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":20},"01M78VFJ4N00J9RMF7X5AVZY7C","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fwebapp-testing\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":20},"01M78VF9C8TQ37WGS6WBT77BVW","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":20},"01M78VF5VFD2CA77AM9AVBXR7C","vercel-deploy","Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as \"Deploy my app\", \"Deploy this to production\", \"Create a preview deployment\", \"Deploy and give me the link\", or \"Push this live\". No authentication required - returns preview URL and claimable deployment link.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M78VF0JF37J4KCM4Y30Z9E55","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[],[]]