vitest-testing

Solid

Modern TypeScript/JavaScript testing with Vitest. Fast unit and integration tests, native ESM support, Vite-powered HMR, and comprehensive mocking. Use for testing TS/JS projects.

Testing & QA 162 stars 25 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Vitest Testing Expert knowledge for testing JavaScript/TypeScript projects using Vitest - a blazingly fast testing framework powered by Vite. ## Quick Start ### Installation ```bash # Using Bun (recommended) bun add -d vitest # Using npm npm install -D vitest ``` ### Configuration ```typescript // vitest.config.ts import { defineConfig } from 'vitest/config' export default defineConfig({ test: { globals: true, environment: 'node', // or 'jsdom' coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], thresholds: { lines: 80, functions: 80, branches: 80 }, }, include: ['**/*.{test,spec}.{js,ts,jsx,tsx}'], }, }) ``` ## Running Tests ```bash # Run all tests (prefer bun) bun test # Watch mode (default) bun test --watch # Run once (CI mode) bun test --run # With coverage bun test --coverage # Specific file bun test src/utils/math.test.ts # Pattern matching bun test --grep="calculates sum" # UI mode (interactive) bun test --ui # Verbose output bun test --reporter=verbose ``` ## Writing Tests ### Basic Structure ```typescript import { describe, it, expect, beforeEach, afterEach } from 'vitest' import { add, subtract } from './math' describe('Math utilities', () => { beforeEach(() => { // Setup before each test }) it('adds two numbers correctly', () => { expect(add(2, 3)).toBe(5) }) it('subtracts two numbers correctly', () => { expect(subtract(5, 3)).toBe(2) }) }) ``` ### Parametrized T...

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
6 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category