get most verbose logging on travis while keeping standard npm test quiet
diff --git a/.travis.yml b/.travis.yml
index da796b4..9c0aa3b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,4 +35,4 @@
- ./travis/scancode.sh
script:
- - npm test; cat build/mocha.test.log
+ - npm run test-verbose
diff --git a/package.json b/package.json
index 1ddc287..e2872f5 100644
--- a/package.json
+++ b/package.json
@@ -20,8 +20,9 @@
},
"scripts": {
"pretest": "npm install --no-save ngrok",
- "test": "WSKDEBUG_QUIET=1 nyc mocha test/**/*.test.js && test/install/test-npm-install.sh",
- "posttest": "eslint .",
+ "test": "WSKDEBUG_QUIET=${WSKDEBUG_QUIET:-1} nyc mocha test/**/*.test.js",
+ "test-verbose": "WSKDEBUG_QUIET=0 DEBUG=wskdebug npm run test -- -v",
+ "posttest": "test/install/test-npm-install.sh && eslint .",
"report-coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json"
},
"nyc": {
diff --git a/src/log.js b/src/log.js
index c3c136d..1d898e2 100644
--- a/src/log.js
+++ b/src/log.js
@@ -220,6 +220,6 @@
isInteractive: spinner.isEnabled
};
-if (process.env.WSKDEBUG_QUIET) {
+if (process.env.WSKDEBUG_QUIET === "1") {
module.exports.quiet(true);
}
diff --git a/test/wskdebug.test.js b/test/wskdebug.test.js
index e771336..7da1798 100644
--- a/test/wskdebug.test.js
+++ b/test/wskdebug.test.js
@@ -69,7 +69,6 @@
const stdio = test.endCaptureStdout();
- assert.equal(stdio.stderr, "");
// testing a couple strings that should rarely change
assert(stdio.stdout.includes("Debug an Apache OpenWhisk <action> by forwarding its activations to a local docker"));
assert(stdio.stdout.includes("Supported kinds:"));
@@ -87,7 +86,6 @@
await wskdebug(`--version`);
const stdio = test.endCaptureStdout();
- assert.equal(stdio.stderr, "");
assert.equal(stripAnsi(stdio.stdout.trim()), require(`${process.cwd()}/package.json`).version);
});