Created
February 10, 2017 05:43
-
-
Save shallwefootball/89e9b9a111ceaff912de2d28180b7af0 to your computer and use it in GitHub Desktop.
didn't mockReset created by shallwefootball - https://repl.it/Feas/8
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
{ | |
"testRegex": ".*-test.js", | |
"testEnvironment": "node" | |
} |
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
const fetch = require('./fetch'); | |
describe('fetch', () => { | |
it('called with GET', () => { | |
fetch.req = jest.fn(); | |
fetch.reqGet(); | |
expect(fetch.req).toBeCalledWith('GET'); | |
}); | |
it('i want mockReset', () => { | |
fetch.req.mockReset(); | |
console.log('did not mockReset.. T.T', fetch.req); | |
}); | |
}); | |
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
exports.req = method => { | |
return `request method ${method}` | |
} | |
exports.reqGet = () => { | |
return this.req('GET'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment