diff --git a/packages/utils/src/diff/normalizeDiffOptions.ts b/packages/utils/src/diff/normalizeDiffOptions.ts index 80f5bd28952a..13f86339b7a5 100644 --- a/packages/utils/src/diff/normalizeDiffOptions.ts +++ b/packages/utils/src/diff/normalizeDiffOptions.ts @@ -30,7 +30,7 @@ function getDefaultOptions(): DiffOptionsNormalized { compareKeys: undefined, contextLines: DIFF_CONTEXT_DEFAULT, emptyFirstOrLastLinePlaceholder: '', - expand: true, + expand: false, includeChangeCounts: false, omitAnnotationLines: false, patchColor: c.yellow, diff --git a/test/config/test/__snapshots__/diff.test.ts.snap b/test/config/test/__snapshots__/diff.test.ts.snap index 97d53a7cb4ec..dc16194cb39c 100644 --- a/test/config/test/__snapshots__/diff.test.ts.snap +++ b/test/config/test/__snapshots__/diff.test.ts.snap @@ -1,12 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`inline diff options: { expand: false, printBasicPrototype: true } 1`] = ` +exports[`inline diff options: { expand: true } 1`] = ` [ "- Expected + Received -@@ -1,7 +1,7 @@ - Array [ + [ - 1000, + 0, 1, @@ -14,7 +13,10 @@ exports[`inline diff options: { expand: false, printBasicPrototype: true } 1`] = 3, 4, 5, -@@ -12,11 +12,11 @@ + 6, + 7, + 8, + 9, 10, 11, 12, @@ -27,7 +29,9 @@ exports[`inline diff options: { expand: false, printBasicPrototype: true } 1`] = 18, 19, 20, -@@ -26,7 +26,7 @@ + 21, + 22, + 23, 24, 25, 26, @@ -39,13 +43,13 @@ exports[`inline diff options: { expand: false, printBasicPrototype: true } 1`] = "- Expected + Received - Object { - "arr": Array [ + { + "arr": [ 1, - 3, + 2, ], - "obj": Object { + "obj": { - "k": "bar", + "k": "foo", }, @@ -53,12 +57,13 @@ exports[`inline diff options: { expand: false, printBasicPrototype: true } 1`] = ] `; -exports[`inline diff options: undefined 1`] = ` +exports[`inline diff options: { printBasicPrototype: true } 1`] = ` [ "- Expected + Received - [ +@@ -1,7 +1,7 @@ + Array [ - 1000, + 0, 1, @@ -66,10 +71,7 @@ exports[`inline diff options: undefined 1`] = ` 3, 4, 5, - 6, - 7, - 8, - 9, +@@ -12,11 +12,11 @@ 10, 11, 12, @@ -82,9 +84,7 @@ exports[`inline diff options: undefined 1`] = ` 18, 19, 20, - 21, - 22, - 23, +@@ -26,7 +26,7 @@ 24, 25, 26, @@ -96,13 +96,13 @@ exports[`inline diff options: undefined 1`] = ` "- Expected + Received - { - "arr": [ + Object { + "arr": Array [ 1, - 3, + 2, ], - "obj": { + "obj": Object { - "k": "bar", + "k": "foo", }, diff --git a/test/config/test/diff.test.ts b/test/config/test/diff.test.ts index 5332c80705d5..95016e7bbb47 100644 --- a/test/config/test/diff.test.ts +++ b/test/config/test/diff.test.ts @@ -3,8 +3,8 @@ import { expect, test } from 'vitest' import { runVitest } from '../../test-utils' test.for([ - [undefined], - [{ expand: false, printBasicPrototype: true }], + [{ expand: true }], + [{ printBasicPrototype: true }], ])(`inline diff options: %o`, async ([options]) => { const { ctx } = await runVitest({ root: './fixtures/diff', diff --git a/test/core/test/jest-expect.test.ts b/test/core/test/jest-expect.test.ts index e473c8d586f8..5734b5a135f7 100644 --- a/test/core/test/jest-expect.test.ts +++ b/test/core/test/jest-expect.test.ts @@ -1618,7 +1618,7 @@ function snapshotError(f: () => unknown) { f() } catch (error) { - const e = processError(error) + const e = processError(error, { expand: true }) expect({ message: stripVTControlCharacters(e.message), diff: e.diff ? stripVTControlCharacters(e.diff) : e.diff,