360 Secure SkillHub
360 安全技能中心

convex-test

该 Skill 指导使用 convex-test 与 vitest 针对内存后端编写 Convex 函数测试,覆盖参数与返回值、认证路径、索引和定时函数,并要求测试保持确定性。

分类:开发
convex
热度 57.94
最近更新 2026-10-18 16:51:34

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add convex/agent-skills/convex-test
兼容性
通用兼容
联网要求
联网要求未确认
数据出网
数据不出本机
Metadata
name
convex-test
description
Generate convex-test tests for the app's Convex functions.

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