Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created August 30, 2019 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/7ee366e3b1f9d87463ae93270f935410 to your computer and use it in GitHub Desktop.
Save isaacs/7ee366e3b1f9d87463ae93270f935410 to your computer and use it in GitHub Desktop.
diff --git a/test/tap/outdated-depth.js b/test/tap/outdated-depth.js
index 5cf7c7eda..c3d87c64c 100644
--- a/test/tap/outdated-depth.js
+++ b/test/tap/outdated-depth.js
@@ -47,6 +47,7 @@ test('outdated depth zero', function (t) {
mr({ port: common.port }, function (er, s) {
npm.load(
{
+ depth: 0,
loglevel: 'silent',
registry: common.registry
},
@@ -54,12 +55,22 @@ test('outdated depth zero', function (t) {
npm.install('.', function (er) {
if (er) throw new Error(er)
npm.outdated(function (err, d) {
- t.ifError(err, 'npm outdated ran without error')
+ if (err) {
+ throw err
+ }
t.is(process.exitCode, 1, 'exit code set to 1')
process.exitCode = 0
t.deepEqual(d[0], expected)
- s.close()
- t.end()
+ t.equal(d.length, 1)
+ npm.config.set('depth', 1)
+ npm.outdated(function (err, d) {
+ t.equal(d.length, 2)
+ if (err) {
+ throw err
+ }
+ s.close()
+ t.end()
+ })
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment