Skip to content

Commit 80231ee

Browse files
pedrottimarkcaptain-yossarian
authored andcommitted
expect: Improve report when assertion fails, part 4 (jestjs#7241)
* expect: Improve report when assertion fails, part 4 * Added snapshot test for toHaveLength expected length * Fix prettier lint error * Made improvements requested by thymikee * Make improvements suggested by SimenB * Update CHANGELOG.md * Save the change to resolve the other merge conflict * Deleted assertion_counts.test.js.snap * Replace cannot with must not * Fix prettier lint error
1 parent 119dbc4 commit 80231ee

14 files changed

+793
-542
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
- `[jest-haste-map]` Add `getCacheFilePath` to get the path to the cache file for a `HasteMap` instance ([#7217](https://github.com/facebook/jest/pull/7217))
2828
- `[jest-runtime]` Remove `cacheDirectory` from `ignorePattern` for `HasteMap` if not necessary ([#7166](https://github.com/facebook/jest/pull/7166))
2929
- `[jest-validate]` Add syntax to validate multiple permitted types ([#7207](https://github.com/facebook/jest/pull/7207))
30-
- `[jest-config]` Accept an array as as well as a string for `testRegex` ([#7209](https://github.com/facebook/jest/pull/7209))
30+
- `[jest-config]` Accept an array as as well as a string for `testRegex`([#7209]https://github.com/facebook/jest/pull/7209))
31+
- `[expect/jest-matcher-utils]` Improve report when assertion fails, part 4 ([#7241](https://github.com/facebook/jest/pull/7241))
3132
- `[expect]` Check constructor equality in .toStrictEqual() ([#7005](https://github.com/facebook/jest/pull/7005))
3233
- `[jest-util]` Add `jest.getTimerCount()` to get the count of scheduled fake timers ([#7285](https://github.com/facebook/jest/pull/7285))
3334
- `[jest-config]` Add `dependencyExtractor` option to use a custom module to extract dependencies from files ([#7313](https://github.com/facebook/jest/pull/7313), [#7349](https://github.com/facebook/jest/pull/7349), [#7350](https://github.com/facebook/jest/pull/7350))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`.hasAssertions() throws if expected is not undefined 1`] = `
4+
"<dim>expect(</><red>received</><dim>)[.not].hasAssertions(</><dim>)</>
5+
6+
<bold>Matcher error</>: <green>expected</> value must be omitted or undefined
7+
8+
Expected has type: number
9+
Expected has value: <green>2</>"
10+
`;

0 commit comments

Comments
 (0)