Skip to content

Commit

Permalink
fix(package): update Jest dependencies (#21)
Browse files Browse the repository at this point in the history
Breaking change: indentation of diff has changed
  • Loading branch information
SimenB authored and thymikee committed Jan 30, 2018
1 parent 41ecc9b commit a4b3d51
Show file tree
Hide file tree
Showing 7 changed files with 1,236 additions and 982 deletions.
28 changes: 14 additions & 14 deletions __tests__/__snapshots__/getSnapshotDiffSerializer.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ Snapshot Diff:
- First value
+ Second value
Array [
"foo",
- "bar",
"baz",
+ "quoz",
]
Array [
"foo",
- "bar",
"baz",
+ "quoz",
]
`;

exports[`serialize object diff output 1`] = `
Snapshot Diff:
- First value
+ Second value
Object {
- "foo": "bar",
+ "foo": "baz",
}
Object {
- "foo": "bar",
+ "foo": "baz",
}
`;

exports[`serialize text diff output 1`] = `
Snapshot Diff:
- First value
+ Second value
foo
-bar
baz
+quoz
foo
- bar
baz
+ quoz
`;
123 changes: 63 additions & 60 deletions __tests__/__snapshots__/snapshotDiff.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ exports[`can colorize diff 1`] = `
- First value
+ Second value
@@ -5,8 +5,9 @@
 some
 some
 some
 some
 not
+ so
 very
 long
 script"
@@ -5,9 +5,10 @@
 some
 some
 some
 some
 not
+ so
 very
 long
 script
 "
`;

exports[`can expand diff 1`] = `
Expand All @@ -34,7 +35,8 @@ exports[`can expand diff 1`] = `
+ so
very
long
script"
script
"
`;

exports[`can use contextLines on diff 1`] = `
Expand All @@ -43,7 +45,7 @@ exports[`can use contextLines on diff 1`] = `
+ Second value
@@ -10,0 +10,1 @@
+ so"
+ so"
`;

exports[`can use contextLines with React components 1`] = `
Expand All @@ -52,31 +54,32 @@ exports[`can use contextLines with React components 1`] = `
+ <Component test=\\"my name\\" />
@@ -6,1 +6,1 @@
- say
+ my name
- say
+ my name
@@ -9,1 +9,1 @@
- say
+ my name
- say
+ my name
@@ -32,1 +32,1 @@
- say
+ my name"
- say
+ my name"
`;

exports[`collapses diffs and strips ansi by default 1`] = `
"Snapshot Diff:
- First value
+ Second value
@@ -5,8 +5,9 @@
some
some
some
some
not
+ so
very
long
script"
@@ -5,9 +5,10 @@
some
some
some
some
not
+ so
very
long
script
"
`;

exports[`detects React components 1`] = `
Expand All @@ -85,44 +88,44 @@ exports[`detects React components 1`] = `
+ <Component test=\\"my name\\" />
@@ -1,14 +1,14 @@
<div>
<span />
<span />
<span />
<span>
- say
+ my name
</span>
<span>
- say
+ my name
</span>
<span />
<span />
<span />
<span />
<div>
<span />
<span />
<span />
<span>
- say
+ my name
</span>
<span>
- say
+ my name
</span>
<span />
<span />
<span />
<span />
@@ -27,11 +27,11 @@
<span />
<span />
<span />
<span />
<span>
- say
+ my name
</span>
<span />
<span />
<span />
<span />"
<span />
<span />
<span />
<span />
<span>
- say
+ my name
</span>
<span />
<span />
<span />
<span />"
`;
exports[`diffs short strings 1`] = `
"Snapshot Diff:
- First value
+ Second value
- abcx
+ abcy
"
- abcx
+ abcy
"
`;
47 changes: 25 additions & 22 deletions __tests__/__snapshots__/toMatchDiffSnapshot.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ exports[`proxies "colors" option(s) 1`] = `
- First value
+ Second value
@@ -5,8 +5,9 @@
 some
 some
 some
 some
 not
+ so
 very
 long
 script"
@@ -5,9 +5,10 @@
 some
 some
 some
 some
 not
+ so
 very
 long
 script
 "
`;

exports[`proxies "contextLines" option(s) 1`] = `
Expand All @@ -23,7 +24,7 @@ exports[`proxies "contextLines" option(s) 1`] = `
+ Second value
@@ -10,0 +10,1 @@
+ so"
+ so"
`;

exports[`proxies "expand" option(s) 1`] = `
Expand All @@ -43,22 +44,24 @@ exports[`proxies "expand" option(s) 1`] = `
+ so
very
long
script"
script
"
`;

exports[`works with default options 1`] = `
"Snapshot Diff:
- First value
+ Second value
@@ -5,8 +5,9 @@
some
some
some
some
not
+ so
very
long
script"
@@ -5,9 +5,10 @@
some
some
some
some
not
+ so
very
long
script
"
`;
12 changes: 3 additions & 9 deletions __tests__/snapshotDiff.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ class Component extends React.Component {
<span />
<span />
<span />
<span>
{this.props.test}
</span>
<span>
{this.props.test}
</span>
<span>{this.props.test}</span>
<span>{this.props.test}</span>
<span />
<span />
<span />
Expand All @@ -64,9 +60,7 @@ class Component extends React.Component {
<span />
<span />
<span />
<span>
{this.props.test}
</span>
<span>{this.props.test}</span>
<span />
<span />
<span />
Expand Down
18 changes: 8 additions & 10 deletions __tests__/toMatchDiffSnapshot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ test('works with default options', () => {
expect(a).toMatchDiffSnapshot(b);
});

[
{ expand: true },
{ colors: true },
{ contextLines: 0 },
].forEach((options: any) => {
test(`proxies "${Object.keys(options).join(', ')}" option(s)`, () => {
// $FlowFixMe
expect(a).toMatchDiffSnapshot(b, options);
});
});
[{ expand: true }, { colors: true }, { contextLines: 0 }].forEach(
(options: any) => {
test(`proxies "${Object.keys(options).join(', ')}" option(s)`, () => {
// $FlowFixMe
expect(a).toMatchDiffSnapshot(b, options);
});
}
);
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
"react-test-renderer": ">=15"
},
"dependencies": {
"jest-diff": "test",
"jest-snapshot": "test",
"pretty-format": "^20.0.3",
"jest-diff": "^22.0.6",
"jest-snapshot": "^22.0.6",
"pretty-format": "^22.0.6",
"strip-ansi": "^4.0.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"eslint": "^4.3.0",
"eslint": "~4.13.0",
"eslint-config-callstack-io": "^0.4.0",
"flow-bin": "^0.51.0",
"jest": "test",
"jest": "^22.0.6",
"react": "^15.6.1",
"react-test-renderer": "^15.6.1"
}
Expand Down
Loading

0 comments on commit a4b3d51

Please sign in to comment.