Skip to content

Instantly share code, notes, and snippets.

@areichman
Created February 12, 2015 21:36
Show Gist options
  • Save areichman/c99fbd33a3716cbf8e2a to your computer and use it in GitHub Desktop.
Save areichman/c99fbd33a3716cbf8e2a to your computer and use it in GitHub Desktop.
Create a mock response for the request module using a Jasmine spy
var request = require('request')
spyOn(request, 'get').andCallFake(function(params, callback) {
var res = {
statusCode: 200
}
var body = {
// JSON attributes
}
callback(null, res, body)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment