From f69fed71125f6f81a1dc62454992b3ba48d7d0ff Mon Sep 17 00:00:00 2001 From: gianlucaguarini Date: Sun, 10 Jan 2021 16:53:21 +0100 Subject: [PATCH] updated: improve unit test --- package.json | 2 +- src/logger.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cc61c12..a966cf5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "prepublishOnly": "npm run build", "pretest": "npm run build", "build": "rollup -c", - "test": "eslint src && IGNORE_EXIT_ERRORS=1; nyc --require esm mocha --exit test/index.js" + "test": "export RIOT_CLI_IGNORE_EXIT_ERRORS=1; eslint src && nyc --require esm mocha --exit test/index.js" }, "repository": { "type": "git", diff --git a/src/logger.js b/src/logger.js index 534946f..c1f1497 100644 --- a/src/logger.js +++ b/src/logger.js @@ -8,10 +8,10 @@ export const info = compose(console.info, chalk.cyan) export const panic = error => { logError('A critical error occurred') - if (process.env.BUILD === 'production') { + if (process.env.RIOT_CLI_IGNORE_EXIT_ERRORS) { + throw error + } else { trace(error) process.exit(1) - } else { - throw error } }