Skip to content

Commit

Permalink
refactor: should passing options to next clone
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Oct 15, 2023
1 parent e554a36 commit 2b3d469
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions packages/utils/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,8 @@ export function replaceAsymmetricMatcher(actual: any, expected: any, actualRepla
actualReplaced,
expectedReplaced,
)
if (actualValue !== replaced.replacedActual)
actual[key] = replaced.replacedActual

if (expectedValue !== replaced.replacedExpected)
expected[key] = replaced.replacedExpected
actual[key] = replaced.replacedActual
expected[key] = replaced.replacedExpected
}
})
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function clone<T>(
const descriptor = Object.getOwnPropertyDescriptor(val, k)
if (!descriptor)
continue
const cloned = clone((val as any)[k], seen)
const cloned = clone((val as any)[k], seen, options)
if ('get' in descriptor) {
Object.defineProperty(out, k, {
...descriptor,
Expand Down

0 comments on commit 2b3d469

Please sign in to comment.