Skip to content

Commit d3e8a7c

Browse files
alopezsanchezzkat
authored andcommitted
ci: change console.error for console.log (#79)
Fixes: https://npm.community/t/npm-ci-logs-success-to-stderr/2303 PR-URL: #79 Credit: @alopezsanchez Reviewed-By: @zkat
1 parent 4acd45a commit d3e8a7c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lib/ci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function ci (args, cb) {
3131
.then(
3232
(details) => {
3333
npmlog.disableProgress()
34-
console.error(`added ${details.pkgCount} packages in ${
34+
console.log(`added ${details.pkgCount} packages in ${
3535
details.runTime / 1000
3636
}s`)
3737
}

test/tap/ci.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ test('basic installation', (t) => {
8383
const stdout = ret[1]
8484
const stderr = ret[2]
8585
t.equal(code, 0, 'command completed without error')
86-
t.equal(stdout.trim(), '', 'no output on stdout')
86+
t.equal(stderr.trim(), '', 'no output on stderr')
8787
t.match(
88-
stderr.trim(),
88+
stdout.trim(),
8989
/^added 6 packages in \d+(?:\.\d+)?s$/,
9090
'no warnings on stderr, and final output has right number of packages'
9191
)
@@ -150,9 +150,9 @@ test('supports npm-shrinkwrap.json as well', (t) => {
150150
const stdout = ret[1]
151151
const stderr = ret[2]
152152
t.equal(code, 0, 'command completed without error')
153-
t.equal(stdout.trim(), '', 'no output on stdout')
153+
t.equal(stderr.trim(), '', 'no output on stderr')
154154
t.match(
155-
stderr.trim(),
155+
stdout.trim(),
156156
/^added 6 packages in \d+(?:\.\d+)?s$/,
157157
'no warnings on stderr, and final output has right number of packages'
158158
)
@@ -197,10 +197,8 @@ test('removes existing node_modules/ before installing', (t) => {
197197
], EXEC_OPTS))
198198
.then((ret) => {
199199
const code = ret[0]
200-
const stdout = ret[1]
201200
const stderr = ret[2]
202201
t.equal(code, 0, 'command completed without error')
203-
t.equal(stdout.trim(), '', 'no output on stdout')
204202
t.match(
205203
stderr.trim(),
206204
/^npm.*WARN.*removing existing node_modules/,

0 commit comments

Comments
 (0)