diff --git a/packages/jest-diff/src/index.ts b/packages/jest-diff/src/index.ts index 7c16364bcaae..4b87be7d720f 100644 --- a/packages/jest-diff/src/index.ts +++ b/packages/jest-diff/src/index.ts @@ -122,11 +122,11 @@ function comparePrimitive( } function sortMap(map: Map) { - return new Map([...map.entries()].sort()); + return new Map([...map].sort()); } function sortSet(set: Set) { - return new Set([...set.values()].sort()); + return new Set([...set].sort()); } function compareObjects(