Agent Skills
› ajanraj/OpenChat
› convex-test
convex-test
GitHub用于为 Convex 函数生成基于内存后端的单元测试,覆盖参数、认证、错误路径及定时任务,确保测试确定性。
触发场景
需要为 Convex 查询或变异函数编写单元测试
需要验证 Convex 函数的身份认证逻辑
需要测试 Convex 定时任务的执行流程
安装
npx skills add ajanraj/OpenChat --skill convex-test -g -y
SKILL.md
Frontmatter
{
"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
- 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).
版本历史
- 55de5cd 当前 2026-10-19 22:54


