Created
June 26, 2016 05:54
-
-
Save makemek/e62d3218f743c395e51134d25c168c69 to your computer and use it in GitHub Desktop.
use sinon to spy a string in nodeJs
This file contains hidden or 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
var sinon = require("sinon") | |
str = new String('foo'); | |
var spy = sinon.spy(str, 'replace'); | |
str.replace(str, 'bar'); | |
spy.firstCall.returnValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment