Spies, Stubs & Mocks A Test-Double Library, Not a Test Runner Sinon.js provides test spies, stubs, and mocks for JavaScript — it's paired with a test runner (Mocha, Jest, Jasmine) rather than replacing one, and often com…
ReadCleanup, Fake Timers & Testing Tradeoffs Restoring & Sandboxes const sandbox = sinon.createSandbox() afterEach(() => { sandbox.restore() // restores every fake created via sandbox.stub/spy/mock }) it('does something', ()…
ReadSave this stack to your personal DevRecall — add your own notes, track what you're learning, and share what you know with the community.
Get started — free forever