~/talk

Built-in Tests with Node.js

Talkat JSHeroes 2023 · 2023-05-18..05-19· [nodejs, testing]
slides:none on file

A new built-in testing module node:test exists, imports require the runtime prefix and it supports CJS and ESM; migration from mocha is straightforward and a real project with five test files moves over in about eight months of use. Output formatting changes land in Node 20.2, and the runtime adds conveniences like test.skip/test.todo/test.only. The npm test (npm module) lets teams pin behaviour while upgrading, and the module is already used in production sites and packages.

AI-written summary · about

  1. 0:00Introduction
  2. 3:10Node.js built-in testing added
  3. 5:35Node test runner basics
  4. 8:25Improving test structure
  5. 11:02Real-world test with mocking
  6. 15:54Moving from Mocha to Node test
  7. 16:16Node test as standard tool
  8. 18:25Benefits of test npm package
  9. 21:16Node test growth
  10. 24:05Recent features and future
  11. 25:51Call for contributions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.