diff --git a/packages/calypso-e2e/src/media-helper.ts b/packages/calypso-e2e/src/media-helper.ts index cd15d03ed8b11c..43d6a2d2f0af3f 100644 --- a/packages/calypso-e2e/src/media-helper.ts +++ b/packages/calypso-e2e/src/media-helper.ts @@ -77,15 +77,13 @@ export async function createTestFile( try { await fs.access( sourcePath ); } catch { - console.error( `Source file ${ sourcePath } not found on disk.` ); - throw new Error(); + throw new Error( `Source file ${ sourcePath } not found on disk.` ); } // Obtain the file extension. const extension = path.extname( sourcePath ); if ( ! extension ) { - console.error( `Extension not found on source file ${ sourcePath }` ); - throw new Error(); + throw new Error( `Extension not found on source file ${ sourcePath }` ); } // Generate a filename using current timestamp and a pseudo-randomly generated integer. diff --git a/test/e2e/lib/jest/environment.js b/test/e2e/lib/jest/environment.js index 4a5961fccb9021..ac22d4704b8418 100644 --- a/test/e2e/lib/jest/environment.js +++ b/test/e2e/lib/jest/environment.js @@ -19,6 +19,9 @@ class JestEnvironmentE2E extends JestEnvironmentNode { break; case 'hook_failure': + console.error( event.error ); + this.testFailed = true; + break; case 'test_fn_failure': this.global.__CURRENT_TEST_FAILED__ = true; this.testFailed = true;