Convex Test

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

Generate convex-test tests for the app's Convex functions.

Instructions onlySoftware Development
AI-generated overview

Generates convex-test and vitest tests for an app's Convex functions, covering auth, errors, indexes and scheduled functions.

What it does
This skill guides the creation of automated tests for Convex backend functions using convex-test with vitest against an in-memory backend. It walks through installing the tools, seeding data via t.run, calling t.query and t.mutation, and asserting on arguments and return values. It also covers authentication paths with withIdentity, error paths, and scheduled functions via t.finishInProgressScheduledFunctions. The output is a deterministic test suite run with vitest.
When to use it
Use it when a Convex project needs test coverage for its queries, mutations and scheduled functions. It fits situations where tests should run in memory rather than against a live deployment, and where auth and error paths must be verified alongside the happy path.
Requirements
Requires a Convex project plus the convex-test and vitest packages installed. Tests run against an in-memory backend, so no live deployment or network access is needed. The skill ships no scripts; it is instructions only.
<!-- GENERATED from convex-agents content/capabilities/test.json — do not edit by hand. -->

Generate Convex tests

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

Workflow

  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/agent-skillsinskills/convex-testat commit2cfe645

License: No license

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

Report or request removal