LabscoConnect MCP ↗
get-convex logo✓ Official★ 63

convex-test

Writes automated tests for a Convex app's functions with convex-test and Vitest, which run against an in-memory backend instead of a live deployment. Tests cover inputs and outputs, signed-in and signed-out paths, indexes and scheduled jobs.

by get-convexpart of get-convex/agent-skills

One of 30 skills in the get-convex/agent-skills package — works on its own, and pairs well with its siblings.

WHEN YOUR AGENT SHOULD USE IT

A QUICK BOUNDARY

USE FOR

  • Test queries and mutations without touching real data.
  • Check what happens for signed-in and signed-out users.
  • Test that scheduled functions run as expected.

DO NOT USE FOR

  • Proving one finished feature as several users: that is the verify skill.

Documents

This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.

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).

Installation

Copy & paste — that's it
npx skills add get-convex/agent-skills --skill "convex-test" --full-depth

Run this in your project — your agent picks the skill up automatically.

License

Licensed under Apache-2.0— you can use, modify, and redistribute it under that license's terms.

View the full license file on GitHub →