Last active
August 8, 2020 13:18
-
-
Save LarryLuTW/0ce4e274e25c63c589c78f60f7ee52ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stubBar = sinon.stub(foo, 'bar').returns(50) | |
console.log(stubBar.called, stubBar.callCount) // false 0 | |
foo.bar() | |
console.log(stubBar.called, stubBar.callCount) // true 1 | |
foo.bar() | |
foo.bar() | |
console.log(stubBar.called, stubBar.callCount) // true 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment