mcpField
C
convex-test

convex-test

github.com/convexTesting & quality6937.0k installsUpdated 1d ago
Repository

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

  1. 01Creates tests with convex-test and vitest
  2. 02Exercises queries and mutations
  3. 03Checks arguments and return values
  4. 04Covers auth, errors, and scheduled functions
  5. 05Keeps tests deterministic

Use cases

  1. 01Testing Convex functions without deployment
  2. 02Checking authentication and error paths
  3. 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-test

After installing, type/convex-testin Claude Code to confirm it loaded.

Details

From the project README

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

Comments

Markdown supported