Skip to content

Instantly share code, notes, and snippets.

@simenbrekken
simenbrekken / superagent.js
Created September 2, 2014 15:04
Jest Superagent Mock
/* global jest */
var superagent = jest.genMockFunction().mockReturnThis();
var Response = jest.genMockFunction().mockImplementation(function() {
this.status = 200;
this.ok = true;
});
Response.prototype.get = jest.genMockFunction();