Skip to content

Commit

Permalink
fix: call destroy on v8-to-istanbul converters to free memory (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 27, 2021
1 parent 6eec84c commit 7b9b6f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@

### Fixes

- `[jest-reporters]` Call `destroy` on `v8-to-istanbul` converters to free memory ([#11896](https://github.com/facebook/jest/pull/11896))

### Chore & Maintenance

### Performance
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/package.json
Expand Up @@ -32,7 +32,7 @@
"source-map": "^0.6.0",
"string-length": "^4.0.1",
"terminal-link": "^2.0.0",
"v8-to-istanbul": "^8.0.0"
"v8-to-istanbul": "^8.1.0"
},
"devDependencies": {
"@jest/test-utils": "^27.2.2",
Expand Down
6 changes: 5 additions & 1 deletion packages/jest-reporters/src/CoverageReporter.ts
Expand Up @@ -471,7 +471,11 @@ export default class CoverageReporter extends BaseReporter {

converter.applyCoverage(res.functions);

return converter.toIstanbul();
const istanbulData = converter.toIstanbul();

converter.destroy();

return istanbulData;
}),
);

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -2676,7 +2676,7 @@ __metadata:
string-length: ^4.0.1
strip-ansi: ^6.0.0
terminal-link: ^2.0.0
v8-to-istanbul: ^8.0.0
v8-to-istanbul: ^8.1.0
peerDependencies:
node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
peerDependenciesMeta:
Expand Down Expand Up @@ -21815,14 +21815,14 @@ react-native@0.64.0:
languageName: node
linkType: hard

"v8-to-istanbul@npm:^8.0.0":
version: 8.0.0
resolution: "v8-to-istanbul@npm:8.0.0"
"v8-to-istanbul@npm:^8.1.0":
version: 8.1.0
resolution: "v8-to-istanbul@npm:8.1.0"
dependencies:
"@types/istanbul-lib-coverage": ^2.0.1
convert-source-map: ^1.6.0
source-map: ^0.7.3
checksum: ada29177f2944438eecb6a2fafb2144553c9dc9e623a253083149f4bbb193d862f93bda3cfde93178f3ca799df67da8f0b87222bde8d415a06550476893de0fc
checksum: a43c4feab9014ed55a0ba62513a96f4a68a156ddccede380934f934bc7c63a992e506033ef133a06013540cc7fcbbce1ec8c2b0352c376033854a94b93cbde44
languageName: node
linkType: hard

Expand Down

0 comments on commit 7b9b6f8

Please sign in to comment.