About convex-test
A skill for generating Convex function tests with convex-test and vitest. It uses an in-memory backend to check arguments, returns, authentication, errors, indexes, and scheduled functions while keeping tests deterministic.
Key features
- 01Test with an in-memory backend
- 02Check arguments and return values
- 03Cover auth and error paths
- 04Test indexes and scheduled functions
- 05Keep tests deterministic
Use cases
- 01Verify Convex queries and mutations
- 02Test authentication and error handling
- 03Check scheduled function behavior
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ get-convex/ agent-skills --skill convex-testAfter installing, type/convex-testin Claude Code to confirm it loaded.
Details
From the project READMEGenerate Convex tests
Use convex-test + vitest to test functions against an in-memory backend: args/returns, auth paths, indexes, and scheduled functions.
Workflow
- Install convex-test + vitest.
- Write tests using convexTest(schema): seed via t.run, call t.query/t.mutation, assert.
- Cover auth (withIdentity), error paths, and scheduled functions (t.finishInProgressScheduledFunctions).
- Run vitest; keep tests deterministic.
Rules
- Use convex-test (in-memory), not a live deployment.
- Cover auth + error paths, not just the happy path.
- Keep tests deterministic (no real time/network).
Comments
Markdown supported