Skip to content

Instantly share code, notes, and snippets.

@chestozo
Created September 15, 2014 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chestozo/d6e2e4ef1c9f72e70d9f to your computer and use it in GitHub Desktop.
Save chestozo/d6e2e4ef1c9f72e70d9f to your computer and use it in GitHub Desktop.
Dynamic value for sinon fakeServer autoRespondAfter property
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