If you're building on Convex and your tests are either missing or hitting a live deployment, this skill walks you through writing them against convex-test, an in-memory backend, using vitest as the runner. It covers the parts that usually get skipped: auth paths via withIdentity, error cases alongside the happy path, and scheduled functions, which you can flush with t.finishInProgressScheduledFunctions instead of waiting on real time. The workflow is simple: seed data with t.run, call your queries and mutations, assert on results. The main thing to watch is determinism. The skill steers you away from real clocks and network calls, which is the right call, but you'll still need to think about how your own functions read time. Worth running once on a function you already understand so you can judge the output.

skills.sh installs
41.1K
GitHub stars
69
last updated
Oct 26, 2026

Install

$ npx -y skills add convex/agent-skills --skill convex-test --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/convex/agent-skills
Categories
Testing & QA, AI & Agent Building, Databases
First seen
Oct 26, 2026

More from convex/agent-skills

All 30
1openai avatarplaywrightopenai/skillsUse when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) vi9.3Kskills.sh installs
2github avatarbreakdown-testgithub/awesome-copilotTest Planning and Quality Assurance prompt that generates comprehensive test strategies, task breakdowns, and quality validation plans for GitHub projects.9.3Kskills.sh installs
3affaan-m avatargolang-testingaffaan-m/everything-claude-codegolang testing8.4Kskills.sh installs
4affaan-m avatartdd-workflowaffaan-m/everything-claude-codetdd workflow6.9Kskills.sh installs
5affaan-m avatarpython-testingaffaan-m/everything-claude-codepython testing6.6Kskills.sh installs
6vinvcn avatartddvinvcn/mattpocock-skills-zh-cn测试驱动开发。适用于用户想用先写测试的方式构建功能或修复缺陷、提到 “red-green-refactor”,或需要集成测试时。6.1Kskills.sh installs