Generated banner for Convex Test
Generated logo for Convex Test

Convex Test

ConvexOfficialPublished by Convex

  • Skill
  • Content generator
  • Software development
  • Apache-2.0
  • No issues found

From the author

Generate convex-test tests for the app's Convex functions.
— the description by Convex

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

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/convex/convex-test/download
  2. Unzip 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

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

Files

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.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download convex-test.zip