Skip to content

Instantly share code, notes, and snippets.

@elee
Last active December 11, 2015 04:28
Show Gist options
  • Save elee/4544817 to your computer and use it in GitHub Desktop.
Save elee/4544817 to your computer and use it in GitHub Desktop.
var sinon = require('sinon');
var hottap = require('hotttap');
var foo = function(url) {
var resp = hottap.hottap(url);
return resp;
};
foo('http://somewhere/over/the/rainbow');
and test:
describe('foo', function() {
it('should yank urls', function() {
var hottap = sinon.mock(hottap, 'hottap', function(url) {
return 'some silly json blob goes here';
});
foo('http://somewhere/else/over/the/rainbow');
// asserts and such
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment