sinon issue #2016 - resetHistory

node v10.24.1
version: master
endpointsharetweet
// Employs 'mini-mocha' to emulate running in the Mocha test runner (mochajs.org) require("@fatso83/mini-mocha").install(); const sinon = require("sinon"); const {assert} = require('referee'); describe('resetHistory', function() { var num = null; beforeEach(function() { console.log("hello"); num = sinon.createStubInstance(Number); }); afterEach(() => { // Restore the default sandbox here sinon.restore(); }); describe('called on individual stub method', function() { it('should clear "called" status on stub', function() { num.toFixed(); assert.isTrue(num.toFixed.called); num.toFixed.resetHistory(); assert.isFalse(num.toFixed.called); }); }); describe('called on module', function() { it('should clear "called" status on all stubs', function() { num.toFixed(); assert.isTrue(num.toFixed.called); sinon.resetHistory(); assert.isFalse(num.toFixed.called); }); }); });
Loading…

no comments

    sign in to comment