# Testing Patterns

> Project test patterns. Applies when writing tests or mocking Convex. Use when this capability is needed.

- Skill: `tomevault-io/testing-patterns-13` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/testing-patterns-13`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/testing-patterns-13/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/testing-patterns-13

---


# Testing

- Framework: Vitest + `bun test`
- Files: `*.test.ts` colocated with source
- Convex: use `convex-test` for backend tests
- Coverage: `bun test --coverage`

## Convex Mocking

```ts
import { convexTest } from "convex-test"
import schema from "./schema"

const t = convexTest(schema)
await t.run(async (ctx) => {
  // test mutations/queries here
})
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/jasondocton) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

