Skip to content

Commit a4b3d51

Browse files
SimenBthymikee
authored andcommitted
fix(package): update Jest dependencies (#21)
Breaking change: indentation of diff has changed
1 parent 41ecc9b commit a4b3d51

7 files changed

+1236
-982
lines changed

__tests__/__snapshots__/getSnapshotDiffSerializer.test.js.snap

+14-14
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ Snapshot Diff:
55
- First value
66
+ Second value
77
8-
Array [
9-
"foo",
10-
- "bar",
11-
"baz",
12-
+ "quoz",
13-
]
8+
Array [
9+
"foo",
10+
- "bar",
11+
"baz",
12+
+ "quoz",
13+
]
1414
`;
1515

1616
exports[`serialize object diff output 1`] = `
1717
Snapshot Diff:
1818
- First value
1919
+ Second value
2020
21-
Object {
22-
- "foo": "bar",
23-
+ "foo": "baz",
24-
}
21+
Object {
22+
- "foo": "bar",
23+
+ "foo": "baz",
24+
}
2525
`;
2626

2727
exports[`serialize text diff output 1`] = `
2828
Snapshot Diff:
2929
- First value
3030
+ Second value
3131
32-
foo
33-
-bar
34-
baz
35-
+quoz
32+
foo
33+
- bar
34+
baz
35+
+ quoz
3636
`;

__tests__/__snapshots__/snapshotDiff.test.js.snap

+63-60
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ exports[`can colorize diff 1`] = `
55
- First value
66
+ Second value
77
8-
@@ -5,8 +5,9 @@
9-
 some
10-
 some
11-
 some
12-
 some
13-
 not
14-
+ so
15-
 very
16-
 long
17-
 script"
8+
@@ -5,9 +5,10 @@
9+
 some
10+
 some
11+
 some
12+
 some
13+
 not
14+
+ so
15+
 very
16+
 long
17+
 script
18+
 "
1819
`;
1920

2021
exports[`can expand diff 1`] = `
@@ -34,7 +35,8 @@ exports[`can expand diff 1`] = `
3435
+ so
3536
very
3637
long
37-
script"
38+
script
39+
"
3840
`;
3941

4042
exports[`can use contextLines on diff 1`] = `
@@ -43,7 +45,7 @@ exports[`can use contextLines on diff 1`] = `
4345
+ Second value
4446
4547
@@ -10,0 +10,1 @@
46-
+ so"
48+
+ so"
4749
`;
4850

4951
exports[`can use contextLines with React components 1`] = `
@@ -52,31 +54,32 @@ exports[`can use contextLines with React components 1`] = `
5254
+ <Component test=\\"my name\\" />
5355
5456
@@ -6,1 +6,1 @@
55-
- say
56-
+ my name
57+
- say
58+
+ my name
5759
@@ -9,1 +9,1 @@
58-
- say
59-
+ my name
60+
- say
61+
+ my name
6062
@@ -32,1 +32,1 @@
61-
- say
62-
+ my name"
63+
- say
64+
+ my name"
6365
`;
6466

6567
exports[`collapses diffs and strips ansi by default 1`] = `
6668
"Snapshot Diff:
6769
- First value
6870
+ Second value
6971
70-
@@ -5,8 +5,9 @@
71-
some
72-
some
73-
some
74-
some
75-
not
76-
+ so
77-
very
78-
long
79-
script"
72+
@@ -5,9 +5,10 @@
73+
some
74+
some
75+
some
76+
some
77+
not
78+
+ so
79+
very
80+
long
81+
script
82+
"
8083
`;
8184

8285
exports[`detects React components 1`] = `
@@ -85,44 +88,44 @@ exports[`detects React components 1`] = `
8588
+ <Component test=\\"my name\\" />
8689
8790
@@ -1,14 +1,14 @@
88-
<div>
89-
<span />
90-
<span />
91-
<span />
92-
<span>
93-
- say
94-
+ my name
95-
</span>
96-
<span>
97-
- say
98-
+ my name
99-
</span>
100-
<span />
101-
<span />
102-
<span />
103-
<span />
91+
<div>
92+
<span />
93+
<span />
94+
<span />
95+
<span>
96+
- say
97+
+ my name
98+
</span>
99+
<span>
100+
- say
101+
+ my name
102+
</span>
103+
<span />
104+
<span />
105+
<span />
106+
<span />
104107
@@ -27,11 +27,11 @@
105-
<span />
106-
<span />
107-
<span />
108-
<span />
109-
<span>
110-
- say
111-
+ my name
112-
</span>
113-
<span />
114-
<span />
115-
<span />
116-
<span />"
108+
<span />
109+
<span />
110+
<span />
111+
<span />
112+
<span>
113+
- say
114+
+ my name
115+
</span>
116+
<span />
117+
<span />
118+
<span />
119+
<span />"
117120
`;
118121
119122
exports[`diffs short strings 1`] = `
120123
"Snapshot Diff:
121124
- First value
122125
+ Second value
123126
124-
125-
- abcx
126-
+ abcy
127-
"
127+
128+
- abcx
129+
+ abcy
130+
"
128131
`;

__tests__/__snapshots__/toMatchDiffSnapshot.test.js.snap

+25-22
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ exports[`proxies "colors" option(s) 1`] = `
55
- First value
66
+ Second value
77
8-
@@ -5,8 +5,9 @@
9-
 some
10-
 some
11-
 some
12-
 some
13-
 not
14-
+ so
15-
 very
16-
 long
17-
 script"
8+
@@ -5,9 +5,10 @@
9+
 some
10+
 some
11+
 some
12+
 some
13+
 not
14+
+ so
15+
 very
16+
 long
17+
 script
18+
 "
1819
`;
1920

2021
exports[`proxies "contextLines" option(s) 1`] = `
@@ -23,7 +24,7 @@ exports[`proxies "contextLines" option(s) 1`] = `
2324
+ Second value
2425
2526
@@ -10,0 +10,1 @@
26-
+ so"
27+
+ so"
2728
`;
2829

2930
exports[`proxies "expand" option(s) 1`] = `
@@ -43,22 +44,24 @@ exports[`proxies "expand" option(s) 1`] = `
4344
+ so
4445
very
4546
long
46-
script"
47+
script
48+
"
4749
`;
4850

4951
exports[`works with default options 1`] = `
5052
"Snapshot Diff:
5153
- First value
5254
+ Second value
5355
54-
@@ -5,8 +5,9 @@
55-
some
56-
some
57-
some
58-
some
59-
not
60-
+ so
61-
very
62-
long
63-
script"
56+
@@ -5,9 +5,10 @@
57+
some
58+
some
59+
some
60+
some
61+
not
62+
+ so
63+
very
64+
long
65+
script
66+
"
6467
`;

__tests__/snapshotDiff.test.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ class Component extends React.Component {
3838
<span />
3939
<span />
4040
<span />
41-
<span>
42-
{this.props.test}
43-
</span>
44-
<span>
45-
{this.props.test}
46-
</span>
41+
<span>{this.props.test}</span>
42+
<span>{this.props.test}</span>
4743
<span />
4844
<span />
4945
<span />
@@ -64,9 +60,7 @@ class Component extends React.Component {
6460
<span />
6561
<span />
6662
<span />
67-
<span>
68-
{this.props.test}
69-
</span>
63+
<span>{this.props.test}</span>
7064
<span />
7165
<span />
7266
<span />

__tests__/toMatchDiffSnapshot.test.js

+8-10
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ test('works with default options', () => {
3939
expect(a).toMatchDiffSnapshot(b);
4040
});
4141

42-
[
43-
{ expand: true },
44-
{ colors: true },
45-
{ contextLines: 0 },
46-
].forEach((options: any) => {
47-
test(`proxies "${Object.keys(options).join(', ')}" option(s)`, () => {
48-
// $FlowFixMe
49-
expect(a).toMatchDiffSnapshot(b, options);
50-
});
51-
});
42+
[{ expand: true }, { colors: true }, { contextLines: 0 }].forEach(
43+
(options: any) => {
44+
test(`proxies "${Object.keys(options).join(', ')}" option(s)`, () => {
45+
// $FlowFixMe
46+
expect(a).toMatchDiffSnapshot(b, options);
47+
});
48+
}
49+
);

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
"react-test-renderer": ">=15"
2121
},
2222
"dependencies": {
23-
"jest-diff": "test",
24-
"jest-snapshot": "test",
25-
"pretty-format": "^20.0.3",
23+
"jest-diff": "^22.0.6",
24+
"jest-snapshot": "^22.0.6",
25+
"pretty-format": "^22.0.6",
2626
"strip-ansi": "^4.0.0"
2727
},
2828
"devDependencies": {
2929
"babel-cli": "^6.24.1",
3030
"babel-preset-env": "^1.6.0",
3131
"babel-preset-flow": "^6.23.0",
3232
"babel-preset-react": "^6.24.1",
33-
"eslint": "^4.3.0",
33+
"eslint": "~4.13.0",
3434
"eslint-config-callstack-io": "^0.4.0",
3535
"flow-bin": "^0.51.0",
36-
"jest": "test",
36+
"jest": "^22.0.6",
3737
"react": "^15.6.1",
3838
"react-test-renderer": "^15.6.1"
3939
}

0 commit comments

Comments
 (0)