Skip to content

Instantly share code, notes, and snippets.

@avaly
Created February 15, 2019 04:43
Show Gist options
  • Save avaly/8965470dfc5891836e57e2f95933f3cd to your computer and use it in GitHub Desktop.
Save avaly/8965470dfc5891836e57e2f95933f3cd to your computer and use it in GitHub Desktop.
jest-nock-leak
{
"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"
}
}
function sum(a, b) {
return a + b;
}
module.exports = sum;
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