Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/utils/src/diff/normalizeDiffOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
40 changes: 20 additions & 20 deletions test/config/test/__snapshots__/diff.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
// 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,
2,
3,
4,
5,
@@ -12,11 +12,11 @@
6,
7,
8,
9,
10,
11,
12,
Expand All @@ -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,
Expand All @@ -39,37 +43,35 @@ 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",
},
}",
]
`;

exports[`inline diff options: undefined 1`] = `
exports[`inline diff options: { printBasicPrototype: true } 1`] = `
[
"- Expected
+ Received

[
@@ -1,7 +1,7 @@
Array [
- 1000,
+ 0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
@@ -12,11 +12,11 @@
10,
11,
12,
Expand All @@ -82,9 +84,7 @@ exports[`inline diff options: undefined 1`] = `
18,
19,
20,
21,
22,
23,
@@ -26,7 +26,7 @@
24,
25,
26,
Expand All @@ -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",
},
Expand Down
4 changes: 2 additions & 2 deletions test/config/test/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion test/core/test/jest-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading