Generate comprehensive tests using the project's testing stack.
/plugin marketplace add judigot/ai/plugin install judigot-ai@judigot/aiGenerate comprehensive tests using the project's testing stack.
src/tests/ or colocated with source*.test.ts, *.test.tsx, *.spec.tsdescribe blocks for groupingit or test for individual casesimport { describe, it, expect, vi, beforeEach } from 'vitest';
describe('ModuleName', () => {
beforeEach(() => {
vi.clearAllMocks();
});
describe('functionName', () => {
it('should handle normal case', () => {
// Arrange
// Act
// Assert
});
it('should handle edge case', () => {
// ...
});
it('should throw on invalid input', () => {
expect(() => fn(null)).toThrow();
});
});
});
import { render, screen, fireEvent } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
describe('Component', () => {
it('should render correctly', () => {
render(<Component />);
expect(screen.getByRole('button')).toBeInTheDocument();
});
it('should handle click', async () => {
const onClick = vi.fn();
render(<Component onClick={onClick} />);
fireEvent.click(screen.getByRole('button'));
expect(onClick).toHaveBeenCalled();
});
});
@testing-library/react queries by priority: getByRole > getByLabelText > getByTextYou are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.