Node.js 71 🟢 Mocking, Spying, and Timers in node:test
The node:test module includes a mocking system built into the runtime. It provides spies, stubs, method replacement, and fake timers without requiring Sinon, Jest, or any other third-party library. The mocking API is exposed through the mock object and through the TestContext object that every test function receives. The distinction between these two entry points…