Repository inventory

thebushidocollective/han

Skills indexed from this repository, with install-style signals scoped to the repo.
6 skills528 GitHub stars0 weekly installsTypeScriptGitHubOwner profile

Overview

This skill teaches professional Vitest testing patterns for TypeScript projects, covering unit tests, mocks, spies, and browser-mode testing. It focuses on practical patterns that improve test reliability, maintainability, and CI readiness. Examples and configuration guidance help teams adopt consistent, production-ready testing workflows.

How this skill works

The skill inspects common testing scenarios and provides concrete patterns: writing isolated unit tests, creating deterministic mocks and spies, running tests in node and browser modes, and integrating Vitest into CI pipelines. It explains configuration choices, lifecycle hooks, environment setup, and strategies for performance and error handling so you can apply patterns directly in your codebase.

When to use it

  • Onboard Vitest into a new TypeScript project
  • Replace brittle tests with clear mocks and spies
  • Configure Vitest for browser-mode or DOM-based tests
  • Integrate tests into CI/CD and quality gates
  • Optimize long-running test suites for speed and parallelism

Best practices

  • Keep unit tests fast and deterministic by using explicit mocks and restoring state between tests
  • Favor small, single-purpose tests that assert behavior rather than implementation
  • Use before/after hooks for setup and teardown to avoid test pollution
  • Configure environment-specific settings (node vs browser) to reduce flakiness
  • Run Vitest in CI with caching and parallelization but profile before changing concurrency

Example use cases

  • Unit testing a library function with isolated mocks and snapshot checks
  • Spying on API client calls to assert request shapes without network calls
  • Running component tests in browser mode for DOM interactions using jsdom or real browsers
  • Adding Vitest to a pipeline with fail-on-coverage and test reporting
  • Migrating Jest tests to Vitest while preserving established patterns

FAQ

Use mocks for unit tests to keep them fast and deterministic; reserve integration tests for end-to-end verification of real integrations.

How do I avoid flaky browser-mode tests?

Ensure consistent environment setup, use explicit waits for async operations, isolate tests, and run in CI with stable browser versions or headless mode.

6 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational