Skip to content

Commit

Permalink
refactor: correct argument names (#7136)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Dec 27, 2024
1 parent f4406f1 commit 8967f09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/utils/src/diff/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ function isReplaceable(obj1: any, obj2: any) {
}

export function printDiffOrStringify(
expected: unknown,
received: unknown,
expected: unknown,
options?: DiffOptions,
): string | undefined {
const { aAnnotation, bAnnotation } = normalizeDiffOptions(options)
Expand All @@ -249,10 +249,10 @@ export function printDiffOrStringify(
&& expected !== received
) {
if (expected.includes('\n') || received.includes('\n')) {
return diffStringsUnified(received, expected, options)
return diffStringsUnified(expected, received, options)
}

const [diffs] = diffStringsRaw(received, expected, true)
const [diffs] = diffStringsRaw(expected, received, true)
const hasCommonDiff = diffs.some(diff => diff[0] === DIFF_EQUAL)

const printLabel = getLabelPrinter(aAnnotation, bAnnotation)
Expand All @@ -273,7 +273,7 @@ export function printDiffOrStringify(
// if (isLineDiffable(expected, received)) {
const clonedExpected = deepClone(expected, { forceWritable: true })
const clonedReceived = deepClone(received, { forceWritable: true })
const { replacedExpected, replacedActual } = replaceAsymmetricMatcher(clonedExpected, clonedReceived)
const { replacedExpected, replacedActual } = replaceAsymmetricMatcher(clonedReceived, clonedExpected)
const difference = diff(replacedExpected, replacedActual, options)

return difference
Expand Down

0 comments on commit 8967f09

Please sign in to comment.