From e2155925d346c7059044fadbc68f59d0be6e120f Mon Sep 17 00:00:00 2001 From: zepumph Date: Tue, 19 May 2020 14:18:43 -0800 Subject: [PATCH] add error logging to pre-commit, https://github.com/phetsims/aqua/issues/90 --- js/scripts/hook-pre-commit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/scripts/hook-pre-commit.js b/js/scripts/hook-pre-commit.js index 5cde354bf..cd1336875 100644 --- a/js/scripts/hook-pre-commit.js +++ b/js/scripts/hook-pre-commit.js @@ -37,6 +37,7 @@ try { const report = lint( [ repo ], true, false, true ); if ( report.errorCount > 0 || report.warningCount > 0 ) { + console.error( `lint failed in ${repo}`, report.results ); process.exit( 1 ); } @@ -49,7 +50,7 @@ catch( e ) { // Run qunit tests if puppeteerQUnit exists in the checked-out SHAs and a test HTML exists. try { const puppeteerQUnit = require( '../../../aqua/js/local/puppeteerQUnit' ); - if ( repo !== 'scenery' ) { + if ( repo !== 'scenery' ) { // scenery unit tests take too long, so skip those ( async () => { const testFilePath = `${repo}/${repo}-tests.html`; const exists = fs.existsSync( `../${testFilePath}` ); @@ -64,6 +65,7 @@ try { await browser.close(); outputToConsole && console.log( `${repo}: ${JSON.stringify( result, null, 2 )}` ); if ( !result.ok ) { + console.error( `unit tests failed in ${repo}`, result ); process.exit( 1 ); // fail as soon as there is one problem } }