diff options
author | gfyoung <gfyoung17@gmail.com> | 2021-09-26 06:18:17 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-09-28 00:25:53 +0300 |
commit | 075fe50565ae5c66df727cdd7df9dd5ed8cd4015 (patch) | |
tree | 93a10d814d320178ed2771fa70e0ea30f73a4f61 /smoke-tests | |
parent | 56d6cfdc0745fe919645389b94efb36760eb4179 (diff) |
fix: restore exit code on "npm outdated"
closes: https://github.com/npm/cli/issues/2556
xref: https://github.com/npm/cli/pull/1750
The xref'ed PR apparently dropped this behavior
without any explanation.
PR-URL: https://github.com/npm/cli/pull/3799
Credit: @gfyoung
Close: #3799
Reviewed-by: @wraithgar
Diffstat (limited to 'smoke-tests')
-rw-r--r-- | smoke-tests/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/smoke-tests/index.js b/smoke-tests/index.js index 5e2d5e071..076c53e78 100644 --- a/smoke-tests/index.js +++ b/smoke-tests/index.js @@ -174,9 +174,13 @@ t.test('npm diff', async t => { t.test('npm outdated', async t => { const cmd = `${npmBin} outdated` - const cmdRes = await exec(cmd) + const cmdRes = await exec(cmd).catch(err => { + t.equal(err.code, 1, 'should exit with error code') + return err + }) - t.matchSnapshot(cmdRes, + t.not(cmdRes.stderr, '', 'should have stderr output') + t.matchSnapshot(String(cmdRes.stdout), 'should have expected outdated output') }) |