All skills
paulrberg avatar

/vitest

@56b7c32
by Paul Bergpaulrberg/agent-skills94 stars
7

Use for Vitest in TypeScript projects (Node, bun, React/Next.js, Effect): write, run, or debug unit/component tests, mocks, testing utilities, and coverage.

Use this Skill: https://skilld.dev/gh/paulrberg/agent-skills/vitest

This session only. Nothing lands on disk.

referencestesting-patterns.md

≈301 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Testing Patterns

Match local naming, imports/globals, DOM utilities, fixtures, and cleanup.

  • For components, drive accessible observable behavior: query by role or label, then visible text, with semantic test IDs last. Keep provider state fresh; centralize a wrapper only when several tests need it. Use jest-dom matchers only when the setup file imports them.
  • Await or return every promise. Wrap callback APIs in a promise; a test callback parameter is Vitest context, not a completion callback. Since v4, pass an options object as the second argument (a numeric final timeout remains supported).
  • Put fixture cleanup with the fixture and scenario data with its test. Use tables only where cases clarify distinct behavior. Use snapshots only for stable, reviewable output; focused assertions are usually better.
  • Do not commit only. Use skips, tags, or concurrency only with an explicit condition and safe isolation.
  • Use browser mode and visual assertions only when the repository already owns browser configuration; do not add it merely for a component test covered by the established environment.

See Test API for version-specific options.

Source: SKILL.md on GitHub

No alertstoday3 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    The skill provides comprehensive instructions for Vitest testing workflows, including configuration, mocking, and troubleshooting. It uses standard developer tools and refers to official Vitest documentation. A minor risk exists regarding indirect prompt injection, as the skill executes code from the repository it operates on, which is typical for development-oriented agents.

  • Sockettoday

    No alerts

  • Snyktoday

    Risk: LOW · No issues

Signed by skilld at 56b7c32. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago

README badge

README badge for paulrberg/agent-skills/vitest