Use when a module needs test coverage - creates tests for adapters, services, islands, and components.
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./packs/astro/skills/dev-create-test/SKILL.mdCreate 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 { describe, it, expect, vi, beforeEach } from 'vitest'
import { xxxService } from '../services/xxx-service'
describe('xxxService', () => {
beforeEach(() => {
vi.stubGlobal('fetch', vi.fn())
})
it('should call correct endpoint', async () => {
const mockResponse = { results: [] }
vi.mocked(fetch).mockResolvedValue({
json: () => Promise.resolve(mockResponse),
} as Response)
await xxxService.list({ page: 1, pageSize: 20 })
expect(fetch).toHaveBeenCalledWith(expect.stringContaining('/xxx'))
})
})// React island
import { describe, it, expect } from 'vitest'
import { render, screen } from '@testing-library/react'
import XxxIsland from '../islands/XxxIsland'
describe('XxxIsland', () => {
it('should render', () => {
render(<XxxIsland prop1="test" />)
expect(screen.getByText('test')).toBeDefined()
})
})Create the test in __tests__/OriginalName.spec.ts.
Run: npx vitest run --reporter=verbose
fernandezbaptiste/specialist-agent
cd716d9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.