Cleanup, 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', …
ReadSpies, 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 c…
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