Skip to main content
skill CX Codex

convex-test — Claude Code skill: what it does, how to install

Generates deterministic vitest tests for Convex backend functions using convex-test. Runs against an in-memory backend without live deployments.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add convex/agent-skills --skill convex-test -a claude-code
Open on GitHub

What convex-test does

This skill guides your coding agent to write tests for Convex functions with vitest. The test suite runs against an in-memory backend provided by convex-test, which eliminates the need for live deployments or network calls.

The workflow relies on convexTest(schema). Tests seed initial state via t.run, execute t.query or t.mutation, and assert expected outputs. The prompt enforces coverage for error cases, auth flows via withIdentity, and scheduled background jobs handled by t.finishInProgressScheduledFunctions.

Your project must have convex-test and vitest installed beforehand.

What it helps with

  • generate vitest test suites for Convex queries and mutations
  • test authentication logic using withIdentity mock identities
  • assert scheduled functions run correctly without real timers
  • validate database indexes and error paths in memory

Example prompts for the agent

  • Write convex-test vitest tests for our user profile mutation
  • Generate tests covering auth error paths using withIdentity for convex/tasks.ts
  • Create in-memory tests that verify scheduled functions finish with t.finishInProgressScheduledFunctions

How to install convex-test

1Skills CLI (Vercel)

npx skills add convex/agent-skills --skill convex-test -a claude-code

2Manually: put the files in place

~/.claude/skills/convex-test/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/convex-test/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about convex-test

How to install convex-test in Claude Code?

Run npx skills add convex/agent-skills --skill convex-test -a claude-code in your project terminal.

What does the convex-test skill do?

It prompts the assistant to produce deterministic in-memory tests for Convex functions. It handles args, returns, indexes, auth checks, and scheduled jobs.

Does convex-test require a running Convex deployment?

No, tests execute against an in-memory backend. You do not need network access or a live project.

Source text

SKILL.md · Apache-2.0
---
name: convex-test
description: "Generate convex-test tests for the app's Convex functions."
---

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

© convex · Apache-2.0 · convex/agent-skills

Similar skills

Everything for Testing and QA →

From the same set32

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor