Skip to content

Commit

Permalink
Fix memory leak from snapshot printing (#5279)
Browse files Browse the repository at this point in the history
* Fix memory leak from obsolete snapshot printing

* Update issue number

* Rm "obsolete" to remove confusion

* Update index.js
  • Loading branch information
rickhanlonii authored and cpojer committed Jan 11, 2018
1 parent 239f1ec commit 4bcfe19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## master
## jest 22.0.6

### Fixes

* `[jest-jasmine2]` Fix memory leak in snapshot reporting ([#5279](https://github.com/facebook/jest/pull/5279))

## jest 22.0.5

Expand Down
3 changes: 2 additions & 1 deletion packages/jest-jasmine2/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ const addSnapshotData = (results, snapshotState) => {
results.snapshot.unmatched = snapshotState.unmatched;
results.snapshot.updated = snapshotState.updated;
results.snapshot.unchecked = !status.deleted ? uncheckedCount : 0;
results.snapshot.uncheckedKeys = uncheckedKeys;
// Copy the array to prevent memory leaks
results.snapshot.uncheckedKeys = Array.from(uncheckedKeys);

return results;
};
Expand Down

0 comments on commit 4bcfe19

Please sign in to comment.