Coding & Development / Testing
Test Function
/TestFunctionTry it in
What it does
Write meaningful tests covering a function — e.g. a 40-line `parseInvoice(buffer)` helper in TypeScript.
How to use
Start from a function such as a 40-line `parseInvoice(buffer)` helper in TypeScript. Point to the function or module and mention the testing framework in use. The result is a test file with edge cases and a note on remaining coverage gaps.
Example
/TestFunction Function: a 40-line `parseInvoice(buffer)` helper in TypeScript Notes: Point to the function or module and mention the testing framework in use. Output: a test file with edge cases and a note on remaining coverage gaps
Run it in
Paste the command, then attach the file or text on the same message - it handles mixed input well.
You might also like
/TestApi
Write meaningful tests covering an API endpoint — e.g. a `POST /api/orders` Express handler with Stripe integration.
/TestConfig
Write meaningful tests covering a config file — e.g. a `docker-compose.yml` running Postgres.
/TestQuery
Write meaningful tests covering a database query — e.g. a 30-line PostgreSQL query joining orders.
/TestComponent
Write meaningful tests covering a UI component — e.g. a React `<PricingTable />` component with three tier props.