My codes:
before(function _before() {
this.myObject = new MyObject();
});
it('should', sinon.test(function() {
const stubLog = sinon.stub(this.myObject.log, 'warn');
}));
it('should 2', sinon.test(function() {
const stubLog = sinon.stub(this.myObject.log, 'warn');
}));
sinon version: 1.17.6
Why I got the error TypeError: Attempted to wrap warn which is already wrapped
in should 2 test? Should I restore stubLog
manually? I think sinon.test()
will do it for me. Maybe I did something wrong?
Any comments welcomed. Thanks