Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- `[jest-jasmine2]` Use prettier through `require` instead of `localRequire`. Fixes `matchInlineSnapshot` where prettier dependencies like `path` and `fs` are mocked with `jest.mock`. ([#6776](https://github.com/facebook/jest/pull/6776))
- `[docs]` Fix contributors link ([#6711](https://github.com/facebook/jest/pull/6711))
- `[website]` Fix website versions page to link to correct language ([#6734](https://github.com/facebook/jest/pull/6734))
- `[expect]` Update `toContain` suggestion to contain equal message ([#6792](https://github.com/facebook/jest/pull/6810))

## 23.4.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,9 @@ exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '[]' 1`] =
Expected array:
<red>[{}, []]</>
To contain value:
<green>[]</> <dim>Looks like you wanted to test for object/array equality with the stricter \`toContain\` matcher. You probably need to use \`toContainEqual\` instead.</>"
<green>[]</>

<dim>Looks like you wanted to test for object/array equality with the stricter \`toContain\` matcher. You probably need to use \`toContainEqual\` instead.</>"
`;

exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '{}' 1`] = `
Expand All @@ -1526,7 +1528,9 @@ exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '{}' 1`] =
Expected array:
<red>[{}, []]</>
To contain value:
<green>{}</> <dim>Looks like you wanted to test for object/array equality with the stricter \`toContain\` matcher. You probably need to use \`toContainEqual\` instead.</>"
<green>{}</>

<dim>Looks like you wanted to test for object/array equality with the stricter \`toContain\` matcher. You probably need to use \`toContainEqual\` instead.</>"
`;

exports[`.toContain(), .toContainEqual() '[0, 1]' contains '1' 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion packages/expect/src/matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const matchers: MatchersObject = {
` ${printReceived(collection)}\n` +
`To contain value:\n` +
` ${printExpected(value)}` +
(suggestToContainEqual ? ` ${SUGGEST_TO_CONTAIN_EQUAL}` : '')
(suggestToContainEqual ? `\n\n${SUGGEST_TO_CONTAIN_EQUAL}` : '')
);
};

Expand Down