Skip to content

Commit

Permalink
Added test to check for re-patching
Browse files Browse the repository at this point in the history
  • Loading branch information
akupila committed Mar 5, 2016
1 parent ac58ad6 commit 4fc32b8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/test.js
Expand Up @@ -28,6 +28,24 @@ describe('shhh', function() {
console.log('This will show up in console'); // Visible

sinon.assert.calledOnce(spy);
spy.reset();
console.log.restore();
});

it('should not re-patch', function() {
var spy = sinon.spy(console, 'log');

shhh.enable();
shhh.enable();
shhh.enable();
console.log('Hidden 1');
console.log('Hidden 2');
console.log('Hidden 3');
shhh.disable();
shhh.disable();
shhh.disable();
console.log('This will show up in console'); // Visible

sinon.assert.calledOnce(spy);
console.log.restore();
})
});

0 comments on commit 4fc32b8

Please sign in to comment.