From d3e8a7c7240dd25379a5bcad324a367c58733c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20L=C3=B3pez?= Date: Mon, 26 Nov 2018 17:04:58 +0100 Subject: [PATCH] ci: change `console.error` for `console.log` (#79) Fixes: https://npm.community/t/npm-ci-logs-success-to-stderr/2303 PR-URL: https://github.com/npm/cli/pull/79 Credit: @alopezsanchez Reviewed-By: @zkat --- lib/ci.js | 2 +- test/tap/ci.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/ci.js b/lib/ci.js index e71d89cfddb2..03822b9528d1 100644 --- a/lib/ci.js +++ b/lib/ci.js @@ -31,7 +31,7 @@ function ci (args, cb) { .then( (details) => { npmlog.disableProgress() - console.error(`added ${details.pkgCount} packages in ${ + console.log(`added ${details.pkgCount} packages in ${ details.runTime / 1000 }s`) } diff --git a/test/tap/ci.js b/test/tap/ci.js index a523f87623aa..9d69e3e5eb52 100644 --- a/test/tap/ci.js +++ b/test/tap/ci.js @@ -83,9 +83,9 @@ test('basic installation', (t) => { const stdout = ret[1] const stderr = ret[2] t.equal(code, 0, 'command completed without error') - t.equal(stdout.trim(), '', 'no output on stdout') + t.equal(stderr.trim(), '', 'no output on stderr') t.match( - stderr.trim(), + stdout.trim(), /^added 6 packages in \d+(?:\.\d+)?s$/, 'no warnings on stderr, and final output has right number of packages' ) @@ -150,9 +150,9 @@ test('supports npm-shrinkwrap.json as well', (t) => { const stdout = ret[1] const stderr = ret[2] t.equal(code, 0, 'command completed without error') - t.equal(stdout.trim(), '', 'no output on stdout') + t.equal(stderr.trim(), '', 'no output on stderr') t.match( - stderr.trim(), + stdout.trim(), /^added 6 packages in \d+(?:\.\d+)?s$/, 'no warnings on stderr, and final output has right number of packages' ) @@ -197,10 +197,8 @@ test('removes existing node_modules/ before installing', (t) => { ], EXEC_OPTS)) .then((ret) => { const code = ret[0] - const stdout = ret[1] const stderr = ret[2] t.equal(code, 0, 'command completed without error') - t.equal(stdout.trim(), '', 'no output on stdout') t.match( stderr.trim(), /^npm.*WARN.*removing existing node_modules/,