diff --git a/lib/commands/completion.js b/lib/commands/completion.js index bce6c3619ccc4..17de3f8af7481 100644 --- a/lib/commands/completion.js +++ b/lib/commands/completion.js @@ -166,7 +166,7 @@ class Completion extends BaseCommand { // at this point, if words[1] is some kind of npm command, // then complete on it. // otherwise, do nothing - const impl = this.npm.cmd(cmd) + const impl = await this.npm.cmd(cmd) if (impl.completion) { const comps = await impl.completion(opts) return this.wrap(opts, comps) diff --git a/test/lib/commands/completion.js b/test/lib/commands/completion.js index 7a7e0a759fbfe..c4addbb291d58 100644 --- a/test/lib/commands/completion.js +++ b/test/lib/commands/completion.js @@ -21,7 +21,7 @@ const npm = { } }, }, - cmd: cmd => { + cmd: async cmd => { return { completion: { completion: () => [['>>', '~/.bashrc']],