Home / Market / generate tests

generate tests

generate-tests

claude-command★ 347020 dlgithubMITInstall in CosmosUpstream Source

Documentation & Preview

--- allowed-tools: Read, Write, Edit, Bash argument-hint: [file-path] | [component-name] description: Generate a complete test file for a specified source file or component. Use when the user explicitly asks to write, create, or generate tests for a specific file.

---

Generate Tests

Generate comprehensive test suite for: $ARGUMENTS

Current Testing Setup

Test Generation Framework

  1. Analyze the target file/component structure — identify all exported functions, classes, methods, and their signatures
  2. Strategy — examine existing test patterns in the project; choose unit vs integration scope; identify critical paths and error scenarios
  3. Mock Design — map all external dependencies (I/O, APIs, timers, dates); create factories for test data; plan cleanup for async operations
  4. Unit Tests — write isolated tests per function/method covering happy path, edge cases, and error conditions; follow AAA pattern (Arrange, Act, Assert)
  5. Integration Tests — test component interactions, API layers with mocked responses, and end-to-end user workflows where applicable
  6. Quality Check — verify naming describes behavior not implementation; confirm 80%+ coverage on critical business logic; ensure test isolation

Framework-Specific Guidance

Best Practices