Created
February 15, 2019 04:43
-
-
Save avaly/8965470dfc5891836e57e2f95933f3cd to your computer and use it in GitHub Desktop.
jest-nock-leak
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
{ | |
"name": "jest-test", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"devDependencies": { | |
"jest": "24.1.0", | |
"nock": "10.0.6", | |
"weak": "1.0.1" | |
} | |
} |
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
function sum(a, b) { | |
return a + b; | |
} | |
module.exports = sum; |
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
require('nock'); | |
const sum = require('./sum'); | |
test('adds 1 + 2 to equal 3', () => { | |
expect(sum(1, 2)).toBe(3); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment