Skip to content

Commit

Permalink
protect against unhandled exception - fixes jest-community#195
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage committed Nov 4, 2018
1 parent ae7aee9 commit 9e31a68
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules/valid-expect-in-promise.js
Expand Up @@ -58,6 +58,7 @@ const isPromiseReturnedLater = (node, testFunctionBody) => {
}
const lastLineInTestFunc = testFunctionBody[testFunctionBody.length - 1];
return (
lastLineInTestFunc &&
lastLineInTestFunc.type === 'ReturnStatement' &&
lastLineInTestFunc.argument.name === promiseName
);
Expand Down

0 comments on commit 9e31a68

Please sign in to comment.