Skip to content

Testing & Tooling

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.

LessonTopic
Built-in Test Runnernode:test, node:assert, test(), describe/it, node --test
Debuggingnode --inspect, Chrome DevTools, breakpoints, console methods
Performanceperf_hooks, performance.now(), PerformanceObserver, avoiding blocking
Ecosystem & ToolchainTypeScript runners, ESLint/Prettier/Biome, nodemon, env files
┌─────────────────────────────────────────────────┐
│ 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 │
└─────────────────────────────────────────────────┘

Node’s built-ins cover most basic needs. Here is a quick decision guide:

Terminal window
# Zero dependencies — use the built-in runner
node --test src/**/*.test.js
# TypeScript without a build step (Node 20.6+)
node --experimental-strip-types src/app.ts
# Faster HMR + watch mode
npx tsx watch src/app.ts
# Lint + format in one tool (zero config)
npx biome check --apply src/
Which Node.js version introduced the built-in `node:test` runner?
Which built-in module is used for measuring execution time in Node.js?
What flag lets Node 20.6+ run TypeScript files directly without a build step?