Skip to content

Commit 4bcfe19

Browse files
rickhanloniicpojer
authored andcommitted
Fix memory leak from snapshot printing (#5279)
* Fix memory leak from obsolete snapshot printing * Update issue number * Rm "obsolete" to remove confusion * Update index.js
1 parent 239f1ec commit 4bcfe19

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
## master
2+
## jest 22.0.6
3+
4+
### Fixes
5+
6+
* `[jest-jasmine2]` Fix memory leak in snapshot reporting ([#5279](https://github.com/facebook/jest/pull/5279))
27

38
## jest 22.0.5
49

packages/jest-jasmine2/src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ const addSnapshotData = (results, snapshotState) => {
174174
results.snapshot.unmatched = snapshotState.unmatched;
175175
results.snapshot.updated = snapshotState.updated;
176176
results.snapshot.unchecked = !status.deleted ? uncheckedCount : 0;
177-
results.snapshot.uncheckedKeys = uncheckedKeys;
177+
// Copy the array to prevent memory leaks
178+
results.snapshot.uncheckedKeys = Array.from(uncheckedKeys);
178179

179180
return results;
180181
};

0 commit comments

Comments
 (0)