About convex-test
convex-test is a skill for creating Convex function tests with convex-test and vitest. It uses an in-memory backend to cover behavior without relying on a live deployment.
Key features
- 01Creates tests with convex-test and vitest
- 02Exercises queries and mutations
- 03Checks arguments and return values
- 04Covers auth, errors, and scheduled functions
- 05Keeps tests deterministic
Use cases
- 01Testing Convex functions without deployment
- 02Checking authentication and error paths
- 03Validating scheduled function behavior
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ 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