Articles tagged with #Vitest
A curated list of engineering series, deep dives, and notes related to #Vitest.
Capstone Project: Building a Custom Vitest Plugin & Test Runner Reporter
Build a custom Vitest reporter plugin from scratch to log execution metrics and export JSON test analytics.
Vitest Workspaces: Multi-Project Monorepo Test Execution Isolation
Configure Vitest Workspaces for multi-project monorepos using vitest.workspace.ts.
Coverage Engines: Bytecode Coverage via V8 AST Counters vs AST Instrumentation with Istanbul
Analyze code coverage providers in Vitest: V8 native bytecode counters vs Istanbul AST instrumentation.
Type-Level Testing: expectTypeOf and Static Type System Assertions
Master type testing in Vitest using expectTypeOf() and vitest typecheck mode.
In-Source Testing & Zero-Overhead Production Dead Code Elimination
Learn how to use Vitest in-source testing to co-locate code and tests without inflating bundle size.
Vitest Browser Mode: Executing Tests in Real Chromium, Firefox, and WebKit Engines
Explore Vitest Browser Mode: executing component tests in real browser engines with native DOM APIs.
Snapshot Testing Engine: AST Serializers, File Formatting, and Inline Snapshots
Learn how Vitest formats, updates, and serializes snapshots using custom snapshot serializers.
Fake Timers, Microtasks, and Event Loop Time Manipulation
Master Vitest's fake timer engine powered by @sinonjs/fake-timers to test intervals, timeouts, and dates.
Mocking Mechanics: vi.fn, vi.spyOn, and Module Hoisting Mechanics
Understand how Vitest module hoisting works, mock functions with vi.fn(), and spy on methods with vi.spyOn().
Assertion Engine Mechanics: First-Principles Comparison of Vitest Matchers
A first-principles deep dive into Vitest's assertion engine. Compare toBe, toEqual, toStrictEqual, toContain, toMatchObject, and spy matchers down to V8 heap pointers and prototype resolution.
Vitest Configuration Mechanics: Merging vite.config.ts, test.include, and Environment Drivers
Learn how Vitest merges Vite configs, configures DOM environments (happy-dom/jsdom), and customizes test includes.
Worker Thread Pool Isolation: How Tinypool & Worker Threads Execute Tests in Parallel
Understand Vitest's process and thread isolation model powered by tinypool and Node worker_threads.
The Vite Module Graph & On-Demand Transformation in Unit Testing
Learn how Vitest leverages Vite's module graph, SSR transformation, and esbuild pipeline for rapid unit testing.
Why Jest Slows Down at Scale: Dual Module Graphs & ESM Interop Bottlenecks
Examine the technical causes of Jest test suite slowdowns: CommonJS transformations, custom module resolution, and memory leaks.
Vitest Architecture & Modern Testing Systems: Series Introduction
Master Vitest from first principles: Vite transform pipelines, tinypool isolation, module hoisting, fake timers, and custom reporters.