Convex Test
ConvexOfficialPublished by Convex
- Skill
- Content generator
- Software development
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to testing Convex backend functions by leveraging the convex-test library in conjunction with Vitest. It focuses on creating an in-memory testing environment that allows developers to validate function arguments, return values, authentication logic, database indexes, and scheduled tasks without requiring a live deployment. The workflow emphasizes deterministic test execution and comprehensive coverage of both happy paths and error scenarios.
What it does
- Sets up an in-memory testing environment for Convex functions.
- Guides the implementation of tests using the convexTest schema.
- Facilitates seeding data and executing queries or mutations.
- Supports testing of authentication paths and identity simulation.
- Provides mechanisms to handle and verify scheduled functions.
- Ensures tests remain deterministic by avoiding real network or time dependencies.
When to use it
- When you need to verify the logic of Convex queries and mutations.
- When testing complex authentication flows and authorization rules.
- When validating the behavior of scheduled functions in an isolated environment.
- When you want to integrate backend testing into a standard Vitest workflow.
Advantages
- Enables fast, local testing without needing a live Convex deployment.
- Ensures test reliability through deterministic execution.
- Allows for granular validation of database operations and indexes.
- Supports comprehensive edge-case testing including error paths.
Usage examples
- “Generate a test for my 'addMessage' mutation using convex-test.”
- The agent will provide a test file structure that initializes the in-memory backend, seeds initial data, calls the mutation, and asserts the expected database state.
- “How do I test an authenticated Convex function?”
- The agent will demonstrate how to use the withIdentity helper to simulate a logged-in user during the test execution.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/convex/convex-test/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip convex-test.zip -d .agents/skills
Documentation by Convex
<!-- 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
Install convex-test + vitest.
Write tests using convexTest(schema): seed via t.run, call t.query/t.mutation, assert.
Cover auth (withIdentity), error paths, and scheduled functions (t.finishInProgressScheduledFunctions).
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).
Files
- ATTRIBUTION.mdAdded by AutoGineer846 B
- LICENSELicence file added by AutoGineer10.7 KiB
- SKILL.md808 B
SKILL.md
<!-- 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
Install convex-test + vitest.
Write tests using convexTest(schema): seed via t.run, call t.query/t.mutation, assert.
Cover auth (withIdentity), error paths, and scheduled functions (t.finishInProgressScheduledFunctions).
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).
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Convex
- Publisher
- Convex (Official)
- Source
- convex/agent-skills · skills/convex-test · commit f60629d
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Convex or Convex.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download convex-test.zip