Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Oct 26, 2020
1 parent 080df3d commit 1e89747
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e/failures/__tests__/throwObjectWithStackProp.test.js
Expand Up @@ -8,4 +8,4 @@
'use strict';

// eslint-disable-next-line no-throw-literal
throw {stack: 42};
throw {stack: 42};
5 changes: 4 additions & 1 deletion packages/jest-message-util/src/index.ts
Expand Up @@ -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.');
Expand Down

0 comments on commit 1e89747

Please sign in to comment.