jest --detectLeaks
tests/test-leak.spec.ts
● Test suite failed to run
EXPERIMENTAL FEATURE!
Your test suite is leaking memory. Please ensure all references are cleaned.
There is a number of things that can leak memory:
- Async operations that have not finished (e.g. fs.readFile).
- Timers not properly mocked (e.g. setInterval, setTimeout).
- Keeping references to the global scope.
at node_modules/jest-cli/build/TestScheduler.js:275:22
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.653s
1) mailgun-js 0.18.0
2) node 10.9.1
I think I narrowed it down to the dependency chain
proxy-agent
->agent-base
. I've raised an issue https://github.com/TooTallNate/node-agent-base/issues/22 to track this.We noticed it because or jest e2e tests were failing due to running our of memory.