Skip to content

Glossary: Node.js Basics

Mock

Also written: mocks, t.mock.method, mocking

A fake function that stands in for a real one and records its calls. Tests use `t.mock.method` to replace `fetch` so no server is needed.

Where the book teaches it

Related terms

node:testfetch