Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add existential-birds/beagle --skill vitest-testinggit clone --depth 1 https://github.com/existential-birds/beagleWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/existential-birds/beagle/vitest-testing)<a href="https://agentmods.dev/skills/existential-birds/beagle/vitest-testing"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/vitest-testing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/existential-birds/beagle/vitest-testing"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/vitest-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00055 | $0.00982 |
| Opus 5.5 | $0.00022 | $0.00393 |
| Sonnet 5.5 | $0.00011 | $0.00196 |
| Haiku 4.5 | $0.00006 | $0.00098 |
Grade A, and why
vitest-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Vitest Best Practices
Quick Reference
import { describe, it, expect, beforeEach, vi } from 'vitest'
describe('feature name', () => {
beforeEach(() => {
vi.clearAllMocks()
})
it('should do something specific', () => {
expect(actual).toBe(expected)
})
it.todo('planned test')
it.skip('temporarily disabled')
it.only('run only this during dev')
})
Common Assertions
// Equality
expect(value).toBe(42) // Strict (===)
expect(obj).toEqual({ a: 1 }) // Deep equality
expect(obj).toStrictEqual({ a: 1 }) // Strict deep (checks types & undefined keys)
// Numbers & Strings/Arrays
expect(0.1 + 0.2).toBeCloseTo(0.3)
expect(str).toMatch(/pattern/)
expect(array).toContain(item)
expect(array).toHaveLength(3)
// Objects
expect(obj).toHaveProperty('nested.key', 'value')
expect(obj).toMatchObject({ subset: 'of properties' })
// Exceptions
expect(() => fn()).toThrow('error message')
expect(() => fn()).toThrow(/pattern/)
Async Testing
// Async/await (preferred)
it('fetches data', async () => {
const data = await fetchData()
expect(data).toEqual({ id: 1 })
})
// Promise matchers - ALWAYS await these
await expect(fetchData()).resolves.toEqual({ id: 1 })
await expect(fetchData()).rejects.toThrow('Error')
// Wrong - creates false positive
expect(promise).resolves.toBe(value) // Missing await!
Quick Mock Reference
const mockFn = vi.fn()
mockFn.mockReturnValue(42)
mockFn.mockResolvedValue({ data: 'value' })
expect(mockFn).toHaveBeenCalled()
expect(mockFn).toHaveBeenCalledWith('arg1', 'arg2')
expect(mockFn).toHaveBeenCalledTimes(2)
For vi.hoisted(), vi.mock(), importOriginal, and mock cleanup, see references/mocking.md.
Verification gates
Use this sequence when you add or change tests; each step has an objective pass condition.
- Run the test suite — From the package or workspace root, run the same command CI uses (check
package.jsonscripts; oftenvitest run,pnpm test, ornpm test). Pass: exit code is 0 and the report shows zero failing tests. - Async matchers — Pass: every
expect(…).resolvesandexpect(…).rejectsis prefixed withawait(await expect(...)), as in Async Testing. A line whereresolvesorrejectsappears withoutawaitfails this gate. - Vitest v4 config compatibility — Pass: config uses top-level
maxWorkers/isolate/fileParallelism(not removed v3poolOptions), explicitcoverage.includefor AST coverage, and@vitest/browser-playwright(provider: playwright()) if Browser Mode is configured.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago Changed · -9 lines · -13 tokens per session 114be43e92fd
- 2mo ago First seen · 118 lines · 68 tokens per session scan A 936bd1d73c4f
vitest-testing is a skill published in the GitHub repository existential-birds/beagle (91 stars, last pushed 4d ago), licensed Apache-2.0. It adds 55 tokens to every session and 982 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-16.
vitest-testing compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| vitest-testingexistential-birds/beagle | Skill | 91 | 4d ago | Apache-2.0 | A | 55 | Claude Code, Codex |
| write-testsGoldziher/ai-rulez | Skill | 182 | 6d ago | MIT | A | 28 | Claude Code |
| Unit Test Scaffold (Python/pytest)s977043/river-review | Skill | 8 | today | MIT | A | 19 | Claude Code |
| pythonUnique-Divine/jiyuu | Skill | 7 | today | MIT | A | 30 | Claude Code, Codex |
| coding-standardsSimon-Hwang/gg-plugins | Skill | 2 | 4mo ago | none | A | 34 | Claude Code |
| codex-rule-routerSimon-Hwang/gg-plugins | Skill | 2 | 4mo ago | none | A | 39 | Claude Code |
| golang-testingaffaan-m/ECC | Skill | 313k | 7d ago | MIT | A | 37 | Claude Code, Kiro |