Skip to content
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

Change "suggest to equal" message to be more advisory #6122

Merged
merged 2 commits into from
May 4, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Features

* `[jest-matcher-utils]` Change "suggest to equal" message to be more advisory
([#6103](https://github.com/facebook/jest/issues/6103))
* `[jest-message-util]` Don't ignore messages with `vendor` anymore
([#6117](https://github.com/facebook/jest/pull/6117))
* `[jest-validate]` Get rid of `jest-config` dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Received: <red>[]</>

Difference:

<dim>Compared values have no visual difference.</> <dim>Looks like you wanted to test for object/array equality with the stricter \`toBe\` matcher. You probably need to use \`toEqual\` instead.</>"
<dim>Compared values have no visual difference.</> <dim>Note that you are testing for equality with the stricter \`toBe\` matcher using \`Object.is\`. For deep equality only, use \`toEqual\` instead.</>"
`;

exports[`.toBe() fails for: {"a": 1} and {"a": 1} 1`] = `
Expand All @@ -301,7 +301,7 @@ Received: <red>{\\"a\\": 1}</>

Difference:

<dim>Compared values have no visual difference.</> <dim>Looks like you wanted to test for object/array equality with the stricter \`toBe\` matcher. You probably need to use \`toEqual\` instead.</>"
<dim>Compared values have no visual difference.</> <dim>Note that you are testing for equality with the stricter \`toBe\` matcher using \`Object.is\`. For deep equality only, use \`toEqual\` instead.</>"
`;

exports[`.toBe() fails for: {"a": 1} and {"a": 5} 1`] = `
Expand Down Expand Up @@ -329,7 +329,7 @@ Received: <red>{}</>

Difference:

<dim>Compared values have no visual difference.</> <dim>Looks like you wanted to test for object/array equality with the stricter \`toBe\` matcher. You probably need to use \`toEqual\` instead.</>"
<dim>Compared values have no visual difference.</> <dim>Note that you are testing for equality with the stricter \`toBe\` matcher using \`Object.is\`. For deep equality only, use \`toEqual\` instead.</>"
`;

exports[`.toBe() fails for: -0 and 0 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-matcher-utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const NUMBERS = [
];

export const SUGGEST_TO_EQUAL = chalk.dim(
'Looks like you wanted to test for object/array equality with the stricter `toBe` matcher. You probably need to use `toEqual` instead.',
'Note that you are testing for equality with the stricter `toBe` matcher using `Object.is`. For deep equality only, use `toEqual` instead.',
);

export const SUGGEST_TO_CONTAIN_EQUAL = chalk.dim(
Expand Down