Angular to Vitest Migration (Nx & Analog)

•
1
•

Guides the migration of Angular test suites from Karma, Jasmine, or Jest to Vitest within Nx workspaces using AnalogJS.

This skill provides a comprehensive framework for transitioning Angular unit and integration tests to the Vitest runner. Specifically tailored for Nx workspaces utilizing AnalogJS integration, it implements a four-phase state machine (Assess, Configure, Transform, Verify) to ensure testing environments are correctly bootstrapped. It resolves complex issues regarding Zone.js patching in both zoned and zoneless environments, provides transformation patterns for legacy Jasmine/Jest spies, and offers specific troubleshooting for common migration errors like 'ProxyZone' mismatches or silent async no-ops.

Key Features

01Automated troubleshooting for missing Zone.js and ProxyZone errors
02Support for Vitest browser mode and DOM environments (jsdom/happy-dom)
03Zoned vs. Zoneless change detection configuration matrix
04Structured 4-phase state machine for reliable migration workflow
05Conversion patterns for Jasmine/Jest spies and matchers to Vitest equivalents
061 GitHub stars

Use Cases

01Migrating legacy Karma/Jasmine suites to high-performance Vitest runners in an Nx monorepo
02Configuring test environments for Angular 18+ zoneless change detection
03Fixing broken fakeAsync/tick/flush calls after an initial Vitest transition