vitest

vitest is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (651 once invoked), scanned A, original, MIT.

A unit-testing framework for JavaScript and TypeScript projects that uses Vite’s build setup. It can replace Jest and supports browser API mocks before tests run.

In plain words
What is it for?
Use it to write and run unit tests, configure shared test setup, and mock browser features such as fetch or localStorage.
Why use it?
It avoids maintaining a separate test configuration and transformation pipeline from the rest of a Vite project.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write and run unit tests, configure shared test setup, and mock browser features such as fetch or localStorage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/vitest
Install

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.

Any agent
npx skills add ashish7802/awesome-api-skills --skill vitest
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

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

agentmods badge for vitest

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/vitest/github.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/vitest)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/vitest"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/vitest/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.

agentmods 80×15 button for vitest

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/vitest"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/vitest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00651
Opus 5 $0.00000 $0.00326
Sonnet 5 $0.00000 $0.00130
Haiku 4.5 $0.00000 $0.00065

Measured 5d ago against content hash ccd56ede55f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

vitest 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (examples/test.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/vitest/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vitest Skill

Next generation testing framework powered by Vite.

Ecosystem Graph Preview

graph LR
  vitest["vitest"]:::core
  classDef core fill:#f9f,stroke:#333,stroke-width:4px;
  vitest -- "works well with" --> playwright
  vitest -- "works well with" --> react
  • playwright (Score: 0.85) Why: Direct relationship, Both are Testing, Shared ecosystem (javascript), Logical next step
  • react (Score: 0.65) Why: Direct relationship, Shared ecosystem (javascript), Logical next step
  • biome (Score: 0.4) Why: Both are Developer Tools, Shared ecosystem (javascript), Can deploy to any

Quick Start

Vitest is a blazing fast unit test framework powered by Vite. It is a drop-in replacement for Jest but significantly faster as it shares the same configuration and transformation pipeline as Vite.

npm install -D vitest

Production Patterns

Setup Files

Instead of importing beforeEach and describe manually in every test file, you can enable globals: true in your vitest.config.ts. Use a setupFiles array to mock global browser APIs (like fetch or localStorage) before any tests run.

Architecture & Scaling

Worker Threads

Vitest runs tests in isolated worker threads. This prevents global state mutations in one test from leaking and corrupting another test. This parallel execution is why Vitest is so fast.

Error Recovery

If tests randomly timeout in CI but pass locally, it is likely because your CI pipeline has significantly fewer CPU cores than your M-series MacBook. Use poolOptions: { threads: { maxThreads: 2 } } in CI to prevent thrashing.

Security Notes

Tests often require API keys. Never commit real API keys to .env.test. Always use msw (Mock Service Worker) to intercept network requests at the network level and return stubbed JSON responses, guaranteeing your test suite never hits real infrastructure.

Read the full file on GitHub · 67 lines

Files

What ships with it

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

Changes

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.

  1. 5d ago First seen · 67 lines · 0 tokens per session scan A ccd56ede55f6

Subscribe to this mod's changes

vitest is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 651 tokens. 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-03.