convex-test
Generates tests for an app's Convex functions using convex-test and vitest against an in-memory backend. It covers argument and return validation, authentication paths via withIdentity, index lookups, error branches, and scheduled functions finished with t.finishInProgressScheduledFunctions. This Skill helps developers get deterministic backend tests running locally without touching a live deployment, so permission and edge-case bugs surface early, before they reach production.
npx skills add https://github.com/convex/agent-skills --skill convex-testBefore / After Comparison
1 组Developers writing tests by hand must first figure out in-memory backend setup, how to inject an identity, and how to trigger scheduled functions. Auth and error branches are usually skipped, and verification depends on manual trial runs against a live deployment.
This Skill produces runnable convex-test + vitest cases covering args and returns, auth and error paths, indexes, and scheduled functions. Everything runs locally on an in-memory backend with deterministic results.
Generate 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).
User Reviews (0)
Write a Review
No reviews yet
Statistics
User Rating
Rate this Skill