Tap Test Generator
This skill automates the creation of backend tests using the tap framework, ensuring consistency with existing project patterns.
Usage
To generate a test, run the generate_test.cjs script with the relative path to the source file you want to test.
bash
node .gemini/skills/tap-test-gen/scripts/generate_test.cjs <SourceFilePath>
Examples:
- •
node .gemini/skills/tap-test-gen/scripts/generate_test.cjs services/choreService.ts - •
node .gemini/skills/tap-test-gen/scripts/generate_test.cjs routes/analytics.ts
What it does
- •Determines the test type (Service vs. Route) based on the file path.
- •Creates a test file in
server/test/<type>/<Filename>.test.ts. - •Populates the file with the appropriate boilerplate:
- •Services: Imports
prismaand sets up a basic test block with teardown. - •Routes: Imports
buildfromapp.jsand sets upapp.injecttesting structure. - •Others: Sets up a generic
taptest block.
- •Services: Imports