mcpField
C
convex-test

convex-test

github.com/get-convexTesting & quality6931.2k installsUpdated 1d ago
Repository

About convex-test

A skill for generating Convex function tests with convex-test and vitest. It uses an in-memory backend to check arguments, returns, authentication, errors, indexes, and scheduled functions while keeping tests deterministic.

Key features

  1. 01Test with an in-memory backend
  2. 02Check arguments and return values
  3. 03Cover auth and error paths
  4. 04Test indexes and scheduled functions
  5. 05Keep tests deterministic

Use cases

  1. 01Verify Convex queries and mutations
  2. 02Test authentication and error handling
  3. 03Check scheduled function behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/get-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