agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/vitest/SKILL.md

vitest

Skill13 starsChanged 28 days agoMITView on GitHub

Next generation testing framework powered by Vite. - 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

  • Reads credentials
  • Installs packages

54 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use nitro, react-hook-form and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    nitro

    Build and deploy universal JavaScript servers with Nitro v3. Use when working with nitro.config.ts, defineNitroConfig, defineHandler, defineConfig, server.ts entry, filesystem routing, route rules, useStorage, defineCachedHandler, useDatabase, definePlugin, runtime hooks, Vercel/Cloudflare deployment, or migrating from Nitro v2/nitropack.

    Also in 5 projects that use this

  • SupabaseSkill

    react-hook-form

    Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,

    Also in 3 projects that use this

  • midudevSkill

    tailwind-css-patterns

    Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

    Also in 4 projects that use this

  • xenitV1Skill

    nodejs-best-practices

    Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.

    Also in 5 projects that use this

  • VercelSkill

    next-cache-components

    Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag

    Also in 4 projects that use this

  • nicepkgSkill

    tailwind-v4-shadcn

    Production-tested setup for Tailwind CSS v4 with shadcn/ui, Vite, and React.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Instead of importing beforeEach and describe manually in every test file, you can enable globals: true in your vitest.config.ts.

    line 33
  2. Very specific:

    If tests randomly timeout in CI but pass locally, it is likely because your CI pipeline has significantly fewer CPU cores than your …

    line 40
  3. Distinctive:

    Use this when your agent works with vitest — structured patterns beat pasted docs and prevent common hallucinations.

    line 49

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

Recommended Next Skills

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

References

Why use this skill

Use this when your agent works with vitest — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Referencing CLI flags or config keys that do not exist
  • Using outdated major versions of tools
  • Skipping lockfile or version pinning in examples

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • playwright — works well with
  • react — works well with

Last Verified: 2026-07-02

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.