Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-08-23 23:17:12 +0300
committerisaacs <i@izs.me>2020-08-23 23:17:12 +0300
commitb38f68acd9292b7432c936db3b6d2d12e896f45d (patch)
tree77baec8c727b3d4ba52fa99c3de98a5837d02c5b /test/lib/utils
parentd159a31a2236882c8ee963ef0443c19a7b7e171f (diff)
ensure npm-command header is sent properly
Reported by @lumaxis
Diffstat (limited to 'test/lib/utils')
-rw-r--r--test/lib/utils/flat-options.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lib/utils/flat-options.js b/test/lib/utils/flat-options.js
index 8ababa982..1d97845f3 100644
--- a/test/lib/utils/flat-options.js
+++ b/test/lib/utils/flat-options.js
@@ -17,7 +17,7 @@ class Mocknpm {
this.color = true
this.projectScope = '@npmcli'
this.tmp = '/tmp'
- this.command = 'test'
+ this.command = null
this.globalPrefix = '/usr/local'
this.localPrefix = '/path/to/npm/cli'
this.prefix = this.localPrefix
@@ -138,6 +138,9 @@ t.test('basic', t => {
cache: generatedFlat.cache.replace(/\\/g, '/')
}
t.matchSnapshot(clean, 'flat options')
+ t.equal(generatedFlat.npmCommand, null, 'command not set yet')
+ npm.command = 'view'
+ t.equal(generatedFlat.npmCommand, 'view', 'command updated via getter')
t.equal(generatedFlat.npmBin, require.main.filename)
// test the object is frozen
generatedFlat.newField = 'asdf'