Skip to content

Commit 60ca308

Browse files
pedrottimarkthymikee
authored andcommitted
jest-diff: Replace diff with diff-sequences package (#6961)
* jest-diff: Replace diff with diff-sequences package * Update CHANGELOG.md * Add Breaking Change in CHANGELOG.md * Rename 4 variables for chalk colors
1 parent 434adc1 commit 60ca308

File tree

5 files changed

+297
-227
lines changed

5 files changed

+297
-227
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Features
44

55
- `[jest-runtime]` Add `jest.isolateModules` for scoped module initialization ([#6701](https://github.com/facebook/jest/pull/6701))
6+
- `[jest-diff]` [**BREAKING**] Replace `diff` with `diff-sequences` package ([#6961](https://github.com/facebook/jest/pull/6961))
67
- `[jest-cli]` [**BREAKING**] Only set error process error codes when they are non-zero ([#7363](https://github.com/facebook/jest/pull/7363))
78
- `[jest-config]` [**BREAKING**] Deprecate `setupTestFrameworkScriptFile` in favor of new `setupFilesAfterEnv` ([#7119](https://github.com/facebook/jest/pull/7119))
89
- `[jest-worker]` [**BREAKING**] Add functionality to call a `setup` method in the worker before the first call and a `teardown` method when ending the farm ([#7014](https://github.com/facebook/jest/pull/7014))

packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,9 +1794,9 @@ Difference:
17941794
<red>+ Received</>
17951795

17961796
<dim> Array [</>
1797-
<red>+ 1,</>
1798-
<dim> 2,</>
1799-
<green>- 1,</>
1797+
<green>- 2,</>
1798+
<dim> 1,</>
1799+
<red>+ 2,</>
18001800
<dim> ]</>"
18011801
`;
18021802

@@ -1963,9 +1963,9 @@ Difference:
19631963
<red>+ Received</>
19641964

19651965
<dim> Immutable.List [</>
1966-
<red>+ 1,</>
1967-
<dim> 2,</>
1968-
<green>- 1,</>
1966+
<green>- 2,</>
1967+
<dim> 1,</>
1968+
<red>+ 2,</>
19691969
<dim> ]</>"
19701970
`;
19711971

@@ -2080,9 +2080,9 @@ Difference:
20802080
<red>+ Received</>
20812081

20822082
<dim> Immutable.OrderedMap {</>
2083-
<red>+ 1: \\"one\\",</>
2084-
<dim> 2: \\"two\\",</>
2085-
<green>- 1: \\"one\\",</>
2083+
<green>- 2: \\"two\\",</>
2084+
<dim> 1: \\"one\\",</>
2085+
<red>+ 2: \\"two\\",</>
20862086
<dim> }</>"
20872087
`;
20882088

@@ -2109,9 +2109,9 @@ Difference:
21092109
<red>+ Received</>
21102110

21112111
<dim> Immutable.OrderedSet [</>
2112-
<red>+ 1,</>
2113-
<dim> 2,</>
2114-
<green>- 1,</>
2112+
<green>- 2,</>
2113+
<dim> 1,</>
2114+
<red>+ 2,</>
21152115
<dim> ]</>"
21162116
`;
21172117

packages/jest-diff/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "build/index.js",
1010
"dependencies": {
1111
"chalk": "^2.0.1",
12-
"diff": "^3.2.0",
12+
"diff-sequences": "^23.6.0",
1313
"jest-get-type": "^22.1.0",
1414
"pretty-format": "^23.6.0"
1515
},

packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ exports[`collapses big diffs to patch format 1`] = `
7676
<dim> 6,</>
7777
<dim> 7,</>
7878
<dim> 8,</>
79-
<red>+ 10,</>
80-
<dim> 9,</>
81-
<green>- 10,</>
79+
<green>- 9,</>
80+
<dim> 10,</>
81+
<red>+ 9,</>
8282
<dim> ],</>
8383
<dim> }</>"
8484
`;
@@ -109,9 +109,9 @@ exports[`context number of lines: -1 (5 default) 1`] = `
109109
<dim> 6,</>
110110
<dim> 7,</>
111111
<dim> 8,</>
112-
<red>+ 10,</>
113-
<dim> 9,</>
114-
<green>- 10,</>
112+
<green>- 9,</>
113+
<dim> 10,</>
114+
<red>+ 9,</>
115115
<dim> ],</>
116116
<dim> }</>"
117117
`;
@@ -120,10 +120,10 @@ exports[`context number of lines: 0 1`] = `
120120
"<green>- Expected</>
121121
<red>+ Received</>
122122
123-
<yellow>@@ -11,0 +11,1 @@</>
124-
<red>+ 10,</>
125-
<yellow>@@ -12,1 +13,0 @@</>
126-
<green>- 10,</>"
123+
<yellow>@@ -11,1 +11,0 @@</>
124+
<green>- 9,</>
125+
<yellow>@@ -13,0 +12,1 @@</>
126+
<red>+ 9,</>"
127127
`;
128128
129129
exports[`context number of lines: 1 1`] = `
@@ -132,9 +132,9 @@ exports[`context number of lines: 1 1`] = `
132132
133133
<yellow>@@ -10,4 +10,4 @@</>
134134
<dim> 8,</>
135-
<red>+ 10,</>
136-
<dim> 9,</>
137-
<green>- 10,</>
135+
<green>- 9,</>
136+
<dim> 10,</>
137+
<red>+ 9,</>
138138
<dim> ],</>"
139139
`;
140140
@@ -145,9 +145,9 @@ exports[`context number of lines: 2 1`] = `
145145
<yellow>@@ -9,6 +9,6 @@</>
146146
<dim> 7,</>
147147
<dim> 8,</>
148-
<red>+ 10,</>
149-
<dim> 9,</>
150-
<green>- 10,</>
148+
<green>- 9,</>
149+
<dim> 10,</>
150+
<red>+ 9,</>
151151
<dim> ],</>
152152
<dim> }</>"
153153
`;
@@ -162,9 +162,9 @@ exports[`context number of lines: null (5 default) 1`] = `
162162
<dim> 6,</>
163163
<dim> 7,</>
164164
<dim> 8,</>
165-
<red>+ 10,</>
166-
<dim> 9,</>
167-
<green>- 10,</>
165+
<green>- 9,</>
166+
<dim> 10,</>
167+
<red>+ 9,</>
168168
<dim> ],</>
169169
<dim> }</>"
170170
`;

0 commit comments

Comments
 (0)