بنقرة واحدة
karma-testing
Write, run, debug, and stabilize Karma/Jasmine tests, especially Angular unit and component tests.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Write, run, debug, and stabilize Karma/Jasmine tests, especially Angular unit and component tests.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Scaffold and register new OpenCode agents in this repository following the modular TypeScript structure. Use when creating, scaffolding, adding, or modifying agents under src/agents/. Triggers on: "create agent", "new agent", "add agent", "scaffold agent", "create a new agent", "nuevo agente", "crear agente", "añadir agente".
Review pull requests and local branch diffs with evidence-based findings, risk assessment, and actionable feedback.
Write, run, debug, and stabilize Jest tests for JavaScript, TypeScript, Node, and React projects.
Angular engineering guidelines for standalone apps, signals, RxJS, templates, routing, and rendering performance. Use this skill when writing, reviewing, or refactoring Angular code to keep components predictable, efficient, and easy to maintain.
| name | karma-testing |
| description | Write, run, debug, and stabilize Karma/Jasmine tests, especially Angular unit and component tests. |
| allowed-tools | Bash(npm:*) Bash(npx:*) Bash(ng:*) |
Use this skill when writing, running, debugging, or stabilizing Karma/Jasmine tests, especially Angular unit, service, and component tests in existing projects.
Angular now defaults to Vitest for new apps, but Karma remains relevant for existing Karma/Jasmine projects.
npm test
npx karma start
ng test
# Run Angular tests in watch mode
ng test
# Run once for local validation or CI
ng test --watch=false
# Headless CI-friendly run
ng test --no-watch --no-progress --browsers=ChromeHeadless
# Generate coverage output
ng test --coverage
# Run with debugging support
ng test --debug
# Add Karma config to an Angular workspace when supported
ng generate config karma
# Run Karma directly once
npx karma start karma.conf.js --single-run
TestBed and ComponentFixture deliberately; avoid heavyweight Angular setup for pure logic that can be constructed directly.imports, not declarations.fixture.detectChanges() intentionally when you want Angular change detection and lifecycle hooks to run.await fixture.whenStable() for async template updates before asserting rendered output.DebugElement and By.css when they make DOM querying or directive inspection clearer.TestBed.inject(...) when Angular DI matters, or isolated construction when it does not.const api = jasmine.createSpyObj('ApiService', ['load']);
api.load.and.returnValue(of([{ id: 1 }]));
TestBed.configureTestingModule({
providers: [{ provide: ApiService, useValue: api }],
});
spyOn(window, 'alert');
jasmine.createSpyObj, spyOn, and provider useValue mocks for collaborators.async/await or fakeAsync/tick for a test; avoid mixing patterns.ng test --debug
ng test --watch=false --browsers=ChromeHeadless
npx karma start karma.conf.js --single-run --log-level debug
fit, fdescribe) before final validation.karma.conf.js, Angular builder options, and test setup files when failures differ between local and CI.ng test --no-watch --no-progress --browsers=ChromeHeadless --coverage
detectChanges() repeatedly without understanding what each call triggers.done, promises, async/await, and fakeAsync in the same spec.