Testing & Tooling
Why tooling matters
Section titled “Why tooling matters”Writing code is only half the job. Knowing how to test, debug, measure, and configure your Node.js environment turns a working script into a maintainable, production-ready application.
Node 18+ ships a built-in test runner, a powerful inspector protocol, and perf_hooks for timing — meaning you can do a lot without installing anything.
What this module covers
Section titled “What this module covers”| Lesson | Topic |
|---|---|
| Built-in Test Runner | node:test, node:assert, test(), describe/it, node --test |
| Debugging | node --inspect, Chrome DevTools, breakpoints, console methods |
| Performance | perf_hooks, performance.now(), PerformanceObserver, avoiding blocking |
| Ecosystem & Toolchain | TypeScript runners, ESLint/Prettier/Biome, nodemon, env files |
The toolchain at a glance
Section titled “The toolchain at a glance”┌─────────────────────────────────────────────────┐│ Your Node.js Project ││ ││ Source code (.ts / .js / .mjs) ││ │ ││ ▼ ││ Linter / Formatter ──► ESLint, Prettier, ││ Biome ││ │ ││ ▼ ││ TypeScript runner ──► tsx, ts-node, ││ --experimental- ││ strip-types ││ │ ││ ▼ ││ Test runner ──► node:test (built-in) ││ or Vitest / Jest ││ │ ││ ▼ ││ Debugger ──► node --inspect + ││ Chrome DevTools ││ │ ││ ▼ ││ Performance ──► perf_hooks, ││ PerformanceObserver │└─────────────────────────────────────────────────┘Choosing what to install
Section titled “Choosing what to install”Node’s built-ins cover most basic needs. Here is a quick decision guide:
# Zero dependencies — use the built-in runnernode --test src/**/*.test.js
# TypeScript without a build step (Node 20.6+)node --experimental-strip-types src/app.ts
# Faster HMR + watch modenpx tsx watch src/app.ts
# Lint + format in one tool (zero config)npx biome check --apply src/