+12
-0
lines changedFilter options
+12
-0
lines changed Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1
1
const t = require('tap')
2
+
const { readdirSync } = require('fs')
2
3
const { dirname } = require('path')
3
4
const { load: loadMockNpm } = require('../../fixtures/mock-npm.js')
4
5
const tmock = require('../../fixtures/tmock.js')
@@ -170,3 +171,14 @@ t.test('non-ascii dash', async t => {
170
171
'arg Argument starts with non-ascii dash, this is probably invalid: \u2010not-a-dash'
171
172
)
172
173
})
174
+
175
+
t.test('exit early for --version', async t => {
176
+
const { cli, outputs, Npm, cache } = await cliMock(t, {
177
+
globals: {
178
+
'process.argv': ['node', 'npm', '-v'],
179
+
},
180
+
})
181
+
await cli(process)
182
+
t.strictSame(readdirSync(cache), [], 'nothing created in cache')
183
+
t.equal(outputs[0], Npm.version)
184
+
})
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4