Skip to content

Commit

Permalink
fix: check for null before storing in weakmap
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Apr 24, 2024
1 parent 1be4510 commit ce36845
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/expect/src/jest-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export function subsetEquality(object: unknown, subset: unknown, customTesters:
return undefined

return Object.keys(subset).every((key) => {
if (typeof subset[key] === 'object') {
if (subset[key] != null && typeof subset[key] === 'object') {
if (seenReferences.has(subset[key]))
return equals(object[key], subset[key], filteredCustomTesters)

Expand Down

0 comments on commit ce36845

Please sign in to comment.