Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(package): update jest dependencies #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
thymikee merged 1 commit into master from update-jest
Jan 30, 2018
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
28 changes: 14 additions & 14 deletions __tests__/__snapshots__/getSnapshotDiffSerializer.test.js.snap
View file Open in desktop
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",
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB do you have any ideas on why do we have extra space in the snapshots?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. It's a diff for jest 21. I'll see if I can isolate it

Copy link
Member Author

@SimenB SimenB Jan 11, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@pedrottimark pedrottimark Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that PR fixed a difference (pardon the pun :) between options:

  • expand: true output a one-space "gutter" between -/+/space and content so content aligned with labels (see can expand diff 1 below)
  • expand: false did not, but now it does, so the snapshot will not change if you toggle the option (for a diff which has fewer lines than the context)

Copy link

@pedrottimark pedrottimark Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You guys are awesome

`;

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
View file Open in desktop
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
"
Copy link

@pedrottimark pedrottimark Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thymikee This change is from jestjs/jest#4520:

  • expand: false option made sure that strings end with newline
  • expand: true did not, and in this case it even trimmed the newline at end of expected and received strings!

`;

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
View file Open in desktop
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
View file Open in desktop
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
View file Open in desktop
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
View file Open in desktop
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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted the lockfile to update all deps within semver, and without also updating eslint-config-callstack-io we are hit by the babel-eslint bug.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, good move

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update the eslint config in the followup PR though

SimenB reacted with thumbs up emoji
"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

AltStyle によって変換されたページ (->オリジナル) /