Test Suite Architect
This skill simplifies the complex task of testing Supabase-integrated services.
Capabilities
- •Scaffold Service Tests: Generates a test file in
test/services/for a given service, pre-configured with a comprehensive Supabase client mock. - •Mocking Guidance: Provides reference patterns for mocking fluent Supabase queries (
.from().select().eq()).
Usage
Create a Service Test
Run this command to create a test file for an existing service.
bash
node .gemini/skills/test-suite-architect/scripts/scaffold_service_test.cjs <serviceName>
Example
To test services/userService.ts:
bash
node .gemini/skills/test-suite-architect/scripts/scaffold_service_test.cjs userService
Output:
test/services/userService.test.ts
Workflow
- •Scaffold: Run the script.
- •Import: Update the test file to import the specific functions you want to test from the service.
- •Mock: Use the patterns in
references/mocking-patterns.mdto define the expected database responses. - •Verify: Run
pnpm testto confirm.
Reference
See mocking-patterns.md for detailed examples of how to mock complex Supabase queries.