بنقرة واحدة
dev-create-test
Use when a module needs test coverage - creates tests for adapters, services, and components.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when a module needs test coverage - creates tests for adapters, services, and components.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when you need a comprehensive code audit covering security, performance, architecture, and dependencies before a release, major refactor, or compliance review.
Use when you want to iteratively build a feature using a PRD as source of truth, with progress tracking and fresh-context iterations - the Autopilot technique for autonomous development.
Use when starting a complex feature, exploring unclear requirements, or needing to challenge assumptions before committing to a design - before /plan.
Use when you need a comprehensive code review combining architecture, security, and test perspectives - especially before merging, releasing, or after major changes.
Use when creating marketing copy for landing pages, email campaigns, product descriptions, or social media - with A/B variants and conversion-focused frameworks.
Use when optimizing landing pages, signup flows, checkout processes, or any user-facing page for higher conversion rates - before A/B testing.
| name | dev-create-test |
| description | Use when a module needs test coverage - creates tests for adapters, services, and components. |
| user-invocable | true |
| argument-hint | [file-path] |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Create tests for the specified file or module.
Target: $ARGUMENTS
Analyze the file to understand what to test.
Determine the test type:
import { describe, it, expect } from 'vitest'
import { xxxAdapter } from '../adapters/xxx.adapter'
describe('xxxAdapter', () => {
describe('toXxx', () => {
it('should convert API response to app contract', () => {
const response = { uuid: '123', field_name: 'test', created_at: '2024-01-01T00:00:00Z' }
const result = xxxAdapter.toXxx(response)
expect(result.id).toBe('123')
expect(result.fieldName).toBe('test')
expect(result.createdAt).toBeInstanceOf(Date)
})
})
})
import { TestBed } from '@angular/core/testing'
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'
import { XxxService } from '../services/xxx.service'
describe('XxxService', () => {
let service: XxxService
let httpMock: HttpTestingController
beforeEach(() => {
TestBed.configureTestingModule({ imports: [HttpClientTestingModule] })
service = TestBed.inject(XxxService)
httpMock = TestBed.inject(HttpTestingController)
})
it('should fetch list', () => {
service.list({ page: 1, pageSize: 20 }).subscribe((data) => {
expect(data).toBeTruthy()
})
const req = httpMock.expectOne('/api/xxx?page=1&pageSize=20')
expect(req.request.method).toBe('GET')
})
})
import { render, screen } from '@testing-library/angular'
import { XxxComponent } from '../components/xxx.component'
describe('XxxComponent', () => {
it('should render', async () => {
await render(XxxComponent, { inputs: { /* ... */ } })
expect(screen.getByText('expected text')).toBeTruthy()
})
})
Create the test in __tests__/original-name.spec.ts.
Run: ng test --watch=false or npx vitest run