Test

by get-convex6ca54f6e2e75No licenseListed Oct 8, 2026Updated Oct 8, 2026

Generate tests for Convex functions with convex-test (queries/mutations/auth/scheduling, in-memory). TRIGGER when the user wants tests / a test suite for their Convex backend / 'how do I test this'.

Instructions onlySoftware Development
AI-generated overview

Generates vitest test suites for Convex backend functions using the in-memory convex-test library.

What it does
Guides the agent through writing tests for Convex queries and mutations with convex-test and vitest against an in-memory backend. It covers seeding data via t.run, calling t.query and t.mutation, asserting args and returns, testing auth paths with withIdentity, error paths, indexes, and scheduled functions via t.finishInProgressScheduledFunctions. It produces deterministic test files and instructions for running vitest.
When to use it
Use when the user wants tests or a test suite for a Convex backend, or asks how to test a Convex function. It fits projects already using Convex and vitest that need coverage of auth, error, and scheduling behavior.
Requirements
Requires the convex-test and vitest packages to be installed, plus a Convex project with a schema. No scripts ship with the skill; it is instructions only. Tests are meant to run in memory without a live deployment, real time, or network access.

Generate Convex tests

Use convex-test + vitest to test functions against an in-memory backend: args/returns, auth paths, indexes, and scheduled functions.

Steps

  1. Install convex-test + vitest.
  2. Write tests using convexTest(schema): seed via t.run, call t.query/t.mutation, assert.
  3. Cover auth (withIdentity), error paths, and scheduled functions (t.finishInProgressScheduledFunctions).
  4. 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).

Source and attribution

Source:get-convex/convex-backend-skillinskills/testat commit6ca54f6

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal