Created
September 15, 2014 08:27
-
-
Save chestozo/d6e2e4ef1c9f72e70d9f to your computer and use it in GitHub Desktop.
Dynamic value for sinon fakeServer autoRespondAfter property
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
var server = sinon.fakeServer.create(); | |
server.autoRespond = true; | |
Object.defineProperty(server, 'autoRespondAfter', { | |
get: function() { | |
if (someSmartCondition) { | |
return 100; | |
} | |
return 10; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment