diff --git a/e2e/failures/__tests__/throwObjectWithStackProp.test.js b/e2e/failures/__tests__/throwObjectWithStackProp.test.js index 5d672f0fcea7..1dfe6d4eb64e 100644 --- a/e2e/failures/__tests__/throwObjectWithStackProp.test.js +++ b/e2e/failures/__tests__/throwObjectWithStackProp.test.js @@ -8,4 +8,4 @@ 'use strict'; // eslint-disable-next-line no-throw-literal -throw {stack: 42}; \ No newline at end of file +throw {stack: 42}; diff --git a/packages/jest-message-util/src/index.ts b/packages/jest-message-util/src/index.ts index 59bdfd1c9b52..b00a981cea7d 100644 --- a/packages/jest-message-util/src/index.ts +++ b/packages/jest-message-util/src/index.ts @@ -391,7 +391,10 @@ export const separateMessageFromStack = ( // If the error is a plain "Error:" instead of a SyntaxError or TypeError we // remove the prefix from the message because it is generally not useful. const ERROR_REGEXP = /^(?:Error: )?([\s\S]*?(?=\n\s*at\s.*:\d*:\d*)|\s*.*)([\s\S]*)$/; - const messageMatch = typeof content !== 'string' ? `${content}`.match(ERROR_REGEXP) : content.match(ERROR_REGEXP); + const messageMatch = + typeof content !== 'string' + ? `${content}`.match(ERROR_REGEXP) + : content.match(ERROR_REGEXP); if (!messageMatch) { // For typescript throw new Error('If you hit this error, the regex above is buggy.');