Skip to content

Commit

Permalink
fix: command completion
Browse files Browse the repository at this point in the history
The fake npm object in the tests wasn't returning an async function

Fixes: #4020
  • Loading branch information
wraithgar committed Nov 10, 2021
1 parent cd6d3a9 commit 5f6beb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/commands/completion.js
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/lib/commands/completion.js
Expand Up @@ -21,7 +21,7 @@ const npm = {
}
},
},
cmd: cmd => {
cmd: async cmd => {
return {
completion: {
completion: () => [['>>', '~/.bashrc']],
Expand Down

0 comments on commit 5f6beb8

Please sign in to comment.