[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix: set `diff.expand: false` as default (#7697)

authored by

Hiroshi Ogawa and committed by
GitHub
(Mar 28, 2025, 10:11 AM +0100) f3420653 5659a0e0

+58 -58
+2 -2
test/config/test/diff.test.ts
··· 3 3 import { runVitest } from '../../test-utils' 4 4 5 5 test.for([ 6 - [undefined], 7 - [{ expand: false, printBasicPrototype: true }], 6 + [{ expand: true }], 7 + [{ printBasicPrototype: true }], 8 8 ])(`inline diff options: %o`, async ([options]) => { 9 9 const { ctx } = await runVitest({ 10 10 root: './fixtures/diff',
+1 -1
test/core/test/jest-expect.test.ts
··· 1618 1618 f() 1619 1619 } 1620 1620 catch (error) { 1621 - const e = processError(error) 1621 + const e = processError(error, { expand: true }) 1622 1622 expect({ 1623 1623 message: stripVTControlCharacters(e.message), 1624 1624 diff: e.diff ? stripVTControlCharacters(e.diff) : e.diff,
+1 -1
packages/utils/src/diff/normalizeDiffOptions.ts
··· 30 30 compareKeys: undefined, 31 31 contextLines: DIFF_CONTEXT_DEFAULT, 32 32 emptyFirstOrLastLinePlaceholder: '', 33 - expand: true, 33 + expand: false, 34 34 includeChangeCounts: false, 35 35 omitAnnotationLines: false, 36 36 patchColor: c.yellow,
+54 -54
test/config/test/__snapshots__/diff.test.ts.snap
··· 1 1 // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html 2 2 3 - exports[`inline diff options: { expand: false, printBasicPrototype: true } 1`] = ` 4 - [ 5 - "- Expected 6 - + Received 7 - 8 - @@ -1,7 +1,7 @@ 9 - Array [ 10 - - 1000, 11 - + 0, 12 - 1, 13 - 2, 14 - 3, 15 - 4, 16 - 5, 17 - @@ -12,11 +12,11 @@ 18 - 10, 19 - 11, 20 - 12, 21 - 13, 22 - 14, 23 - - 2000, 24 - + 15, 25 - 16, 26 - 17, 27 - 18, 28 - 19, 29 - 20, 30 - @@ -26,7 +26,7 @@ 31 - 24, 32 - 25, 33 - 26, 34 - 27, 35 - 28, 36 - - 3000, 37 - + 29, 38 - ]", 39 - "- Expected 40 - + Received 41 - 42 - Object { 43 - "arr": Array [ 44 - 1, 45 - - 3, 46 - + 2, 47 - ], 48 - "obj": Object { 49 - - "k": "bar", 50 - + "k": "foo", 51 - }, 52 - }", 53 - ] 54 - `; 55 - 56 - exports[`inline diff options: undefined 1`] = ` 3 + exports[`inline diff options: { expand: true } 1`] = ` 57 4 [ 58 5 "- Expected 59 6 + Received ··· 103 50 + 2, 104 51 ], 105 52 "obj": { 53 + - "k": "bar", 54 + + "k": "foo", 55 + }, 56 + }", 57 + ] 58 + `; 59 + 60 + exports[`inline diff options: { printBasicPrototype: true } 1`] = ` 61 + [ 62 + "- Expected 63 + + Received 64 + 65 + @@ -1,7 +1,7 @@ 66 + Array [ 67 + - 1000, 68 + + 0, 69 + 1, 70 + 2, 71 + 3, 72 + 4, 73 + 5, 74 + @@ -12,11 +12,11 @@ 75 + 10, 76 + 11, 77 + 12, 78 + 13, 79 + 14, 80 + - 2000, 81 + + 15, 82 + 16, 83 + 17, 84 + 18, 85 + 19, 86 + 20, 87 + @@ -26,7 +26,7 @@ 88 + 24, 89 + 25, 90 + 26, 91 + 27, 92 + 28, 93 + - 3000, 94 + + 29, 95 + ]", 96 + "- Expected 97 + + Received 98 + 99 + Object { 100 + "arr": Array [ 101 + 1, 102 + - 3, 103 + + 2, 104 + ], 105 + "obj": Object { 106 106 - "k": "bar", 107 107 + "k": "foo", 108 108 },