Skip to content

Commit

Permalink
Revise behavior when hook fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
worldomonation committed Sep 2, 2021
1 parent 2ecae76 commit 0581a7d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/e2e/lib/jest/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ class JestEnvironmentE2E extends JestEnvironmentNode {
break;

case 'hook_failure':
console.error( event.error );
this.global.__CURRENT_TEST_FAILED__ = true;
this.testFailed = true;
break;
// Re-throw the error. This triggers Jest to print
// the contents nicely with color code.
throw event.error;

case 'test_fn_failure':
this.global.__CURRENT_TEST_FAILED__ = true;
this.testFailed = true;
Expand Down

0 comments on commit 0581a7d

Please sign in to comment.