From 7b9b6f8e6d8a5731d8e00954c12630235b4d8dee Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Mon, 27 Sep 2021 18:08:22 +0200 Subject: [PATCH] fix: call `destroy` on `v8-to-istanbul` converters to free memory (#11896) --- CHANGELOG.md | 2 ++ packages/jest-reporters/package.json | 2 +- packages/jest-reporters/src/CoverageReporter.ts | 6 +++++- yarn.lock | 10 +++++----- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 095aea686ead..4f749e0b2cdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/packages/jest-reporters/package.json b/packages/jest-reporters/package.json index 3b2c96f6d5e4..f86886de3427 100644 --- a/packages/jest-reporters/package.json +++ b/packages/jest-reporters/package.json @@ -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", diff --git a/packages/jest-reporters/src/CoverageReporter.ts b/packages/jest-reporters/src/CoverageReporter.ts index d1191a1c2d73..590545e4422d 100644 --- a/packages/jest-reporters/src/CoverageReporter.ts +++ b/packages/jest-reporters/src/CoverageReporter.ts @@ -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; }), ); diff --git a/yarn.lock b/yarn.lock index 7b6966926b31..2f58eb87dfe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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: @@ -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