test-suite Skill

Generate comprehensive test suites including unit tests, integration tests, and component tests.

Overview#

The test-suite skill generates production-ready test code using Vitest, Testing Library, and Playwright for unit, integration, and E2E testing.

Usage#

Use the test-suite skill to create tests for my User service and components.

Parameters#

ParameterTypeRequiredDescription
typestringYesTest type: unit, integration, component, e2e
targetstringYesWhat to test: function, component, action, api
coveragebooleanNoInclude coverage configuration
mockingarrayNoModules to mock: prisma, auth, fetch

Generated Output#

Vitest Configuration#

Loading code block...

Test Setup#

Loading code block...

Unit Testing Functions#

Loading code block...

Testing React Components#

Loading code block...

Testing Async Components#

Loading code block...

Testing Server Actions#

Loading code block...

Testing Hooks#

Loading code block...

Mocking Patterns#

Loading code block...

Mock Prisma Client#

Loading code block...

Integration Test Example#

Loading code block...

Features Included#

  • Vitest configuration
  • Test setup with cleanup
  • Unit test patterns
  • Component testing
  • Async testing
  • Server Action testing
  • Hook testing
  • Mocking strategies
  • Integration tests

Running Tests#

Loading code block...

Customization Options#

Use the test-suite skill with: - type: "unit" - target: "function" - coverage: true - mocking: ["prisma", "auth"]

Best Practices#

Test Organization#

__tests__/ unit/ utils.test.ts integration/ api.test.ts e2e/ user-flow.test.ts components/ Button/ Button.tsx Button.test.tsx

Follow AAA Pattern#

Loading code block...

Test Behavior, Not Implementation#

Loading code block...