Node.js
Test Commands
Use Node.js's built-in test runner (node:test) for unit and integration testing. Available since Node 18, it provides describe/it syntax, assertions, and coverage without external dependencies.
7 commands
Pro Tips
Run tests with 'node --test' to discover and run all test files matching the default pattern.
Use 'node --test --watch' for automatic test re-runs during development.
Generate coverage: 'node --test --experimental-test-coverage' — no Istanbul or c8 needed.
Common Mistakes
Node's built-in test runner is stable since Node 20. On Node 18, some features are experimental.
The built-in runner is simpler than Jest/Vitest. For mocking, snapshots, or complex setups, external tools may still be needed.