summaryrefslogtreecommitdiff
path: root/deps/npm/test/lib/commands/run-script.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/lib/commands/run-script.js')
-rw-r--r--deps/npm/test/lib/commands/run-script.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/deps/npm/test/lib/commands/run-script.js b/deps/npm/test/lib/commands/run-script.js
index a265db3cc0..6e2bf22add 100644
--- a/deps/npm/test/lib/commands/run-script.js
+++ b/deps/npm/test/lib/commands/run-script.js
@@ -34,12 +34,12 @@ const mockRs = async (t, { windows = false, runScript, ...opts } = {}) => {
}
t.test('completion', async t => {
- const completion = async (t, remain, pkg) => {
+ const completion = async (t, remain, pkg, isFish = false) => {
const { npm } = await mockRs(t,
pkg ? { prefixDir: { 'package.json': JSON.stringify(pkg) } } : {}
)
const cmd = await npm.cmd('run-script')
- return cmd.completion({ conf: { argv: { remain } } })
+ return cmd.completion({ conf: { argv: { remain } }, isFish })
}
t.test('already have a script name', async t => {
@@ -60,6 +60,13 @@ t.test('completion', async t => {
})
t.strictSame(res, ['hello', 'world'])
})
+
+ t.test('fish shell', async t => {
+ const res = await completion(t, ['npm', 'run'], {
+ scripts: { hello: 'echo hello', world: 'echo world' },
+ }, true)
+ t.strictSame(res, ['hello\techo hello', 'world\techo world'])
+ })
})
t.test('fail if no package.json', async t => {