Skip to content

Commit

Permalink
fix new case for jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Feb 21, 2023
1 parent cf96b70 commit d4b5e47
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/jest-message-util/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,17 @@ export const formatResultsErrors = (

return failedResults
.map(({result, content, failureDetails}) => {
const rootErrorOrStack: Error | string =
failureDetails &&
(types.isNativeError(failureDetails) || failureDetails instanceof Error)
? failureDetails
: content;
const rootErrorOrStack: Error | string = failureDetails
? types.isNativeError(failureDetails) || failureDetails instanceof Error
? failureDetails // receiving raw errors for jest-circus
: typeof failureDetails === 'object' &&
'error' in failureDetails &&
failureDetails.error &&
(types.isNativeError(failureDetails.error) ||
failureDetails.error instanceof Error)
? failureDetails.error // receiving instances of FailedAssertion for jest-jasmine
: content
: content;

const title = `${chalk.bold.red(
TITLE_INDENT +
Expand Down

0 comments on commit d4b5e47

Please sign in to comment.