0.0.5 • Published 6 years ago

jest-leak-fixer v0.0.5

Weekly downloads
2,646
License
MIT
Repository
github
Last release
6 years ago

Jest Memory Leak Fixer

Inspired by @Telokis comment in jest/issues/6399.

Fixes leaks in:

PRs are welcome.

Install

yarn add --dev jest-leak-fixer

Apply

Via CLI

package.json

{
  ...
  "scripts": {
    ...
    "test": "jest-fixer-apply; yarn test:detect-leaks; jest-fixer-restore",
    "test:detect-leaks": "jest --detectLeaks",
  }
}
Via globalSetup/globalTeardown configuration

globalSetup.js

'use strict'
const jestLeakFixer = require('jest-leak-fixer')
...

module.exports = () => {
    jestLeakFixer.apply()
    ...
}

globalTeardown.js

'use strict'
const jestLeakFixer = require('jest-leak-fixer')
...

module.exports = () => {
    ...
    jestLeakFixer.restore()
}
0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago