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

feat(jest-message-util): Add support for Error cause in test and it #13935

Merged
merged 26 commits into from
Feb 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
81bb4c0
Properly report Error cause from test/it
dubzzz Feb 19, 2023
e972e71
fix lint
dubzzz Feb 19, 2023
e2ffe8b
rework paths in tests
dubzzz Feb 19, 2023
3c1cceb
add support for old versions of node
dubzzz Feb 19, 2023
d7524b2
update snap
dubzzz Feb 19, 2023
e42a55e
Update packages/jest-message-util/src/index.ts
dubzzz Feb 19, 2023
56ebf8c
Update packages/jest-message-util/src/index.ts
dubzzz Feb 19, 2023
b0514ee
fix compilation
dubzzz Feb 19, 2023
156a1cf
extract error stack computation function
dubzzz Feb 20, 2023
8e763e7
rename option failureDetails
dubzzz Feb 20, 2023
046875a
update changelog
dubzzz Feb 20, 2023
f556c7a
add failures.test.ts
dubzzz Feb 20, 2023
39bf317
add error with cause support on node 14
dubzzz Feb 21, 2023
0e24922
update error with cause builder
dubzzz Feb 21, 2023
cf96b70
add missing failureDetails: []
dubzzz Feb 21, 2023
d4b5e47
fix new case for jasmine
dubzzz Feb 21, 2023
22df9f7
alter test to run well on jasmine too
dubzzz Feb 21, 2023
b0bd8a1
Revert "alter test to run well on jasmine too"
dubzzz Feb 21, 2023
238590e
Revert "fix new case for jasmine"
dubzzz Feb 21, 2023
808336b
only test for non-jasmine
dubzzz Feb 21, 2023
54df836
Merge remote-tracking branch 'origin/master' into rewrite-stack-extra…
dubzzz Feb 21, 2023
fdd56ca
merge
dubzzz Feb 21, 2023
5b3c4ad
Merge branch 'main' into rewrite-stack-extraction
SimenB Feb 22, 2023
56422b5
Merge remote-tracking branch 'origin/master' into rewrite-stack-extra…
dubzzz Feb 23, 2023
81295f7
simplify and extract nested if
dubzzz Feb 23, 2023
c6fa4a9
type error
dubzzz Feb 23, 2023
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
Prev Previous commit
Next Next commit
fix compilation
dubzzz committed Feb 19, 2023
commit b0514ee738e7ab0fc0cd44a7a5816137bc1ebcc7
6 changes: 5 additions & 1 deletion packages/jest-message-util/src/index.ts
Original file line number Diff line number Diff line change
@@ -410,7 +410,11 @@ export const formatResultsErrors = (
message = indentAllLines(message);

let cause = '';
if ('cause' in errorOrStack && errorOrStack.cause) {
if (
typeof errorOrStack !== 'string' &&
'cause' in errorOrStack &&
errorOrStack.cause
) {
if (
typeof errorOrStack.cause === 'string' ||
types.isNativeError(errorOrStack.cause) ||