diff options
author | Gar <gar+gh@danger.computer> | 2021-11-10 19:30:39 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-11-11 01:35:44 +0300 |
commit | 72ca4a4e39a1d4de03d6423480aa2ee82b021060 (patch) | |
tree | 81c0f265a4eceb14f4bef0c2adbf690d2bb52e3a /tap-snapshots | |
parent | ac4f9e4c55f9f97d99e2a11f0ef5dd9b900b0ef0 (diff) |
fix: command completion
The fake npm object in the tests wasn't returning an async function
Fixes: https://github.com/npm/cli/issues/4020
PR-URL: https://github.com/npm/cli/pull/4032
Credit: @wraithgar
Close: #4032
Reviewed-by: @lukekarrys
Diffstat (limited to 'tap-snapshots')
-rw-r--r-- | tap-snapshots/test/lib/commands/completion.js.test.cjs | 239 |
1 files changed, 239 insertions, 0 deletions
diff --git a/tap-snapshots/test/lib/commands/completion.js.test.cjs b/tap-snapshots/test/lib/commands/completion.js.test.cjs new file mode 100644 index 000000000..13a3f66ef --- /dev/null +++ b/tap-snapshots/test/lib/commands/completion.js.test.cjs @@ -0,0 +1,239 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/commands/completion.js TAP completion --no- flags > flags 1`] = ` +Array [ + Array [ + String( + --no-version + --no-versions + ), + ], +] +` + +exports[`test/lib/commands/completion.js TAP completion commands with no completion > no results 1`] = ` +Array [] +` + +exports[`test/lib/commands/completion.js TAP completion completion cannot complete options that take a value in mid-command > does not try to complete option arguments in the middle of a command 1`] = ` +Array [] +` + +exports[`test/lib/commands/completion.js TAP completion completion completion > both shells 1`] = ` +Array [] +` + +exports[`test/lib/commands/completion.js TAP completion completion completion no known shells > no responses 1`] = ` +Array [] +` + +exports[`test/lib/commands/completion.js TAP completion completion completion wrong word count > no responses 1`] = ` +Array [] +` + +exports[`test/lib/commands/completion.js TAP completion completion of invalid command name does nothing > no results 1`] = ` +Array [] +` + +exports[`test/lib/commands/completion.js TAP completion double dashes escape from flag completion > full command list 1`] = ` +Array [ + Array [ + String( + ci + install-ci-test + install + install-test + uninstall + cache + config + set + get + update + outdated + prune + pack + find-dupes + dedupe + hook + rebuild + link + publish + star + stars + unstar + adduser + login + logout + unpublish + owner + access + team + deprecate + shrinkwrap + token + profile + audit + fund + org + help + ls + ll + search + view + init + version + edit + explore + docs + repo + bugs + root + prefix + bin + whoami + diff + dist-tag + ping + pkg + test + stop + start + restart + run-script + set-script + completion + doctor + exec + explain + un + rb + list + ln + create + i + it + cit + up + c + s + se + tst + t + ddp + v + run + clean-install + clean-install-test + x + why + la + verison + ic + innit + in + ins + inst + insta + instal + isnt + isnta + isntal + install-clean + isntall-clean + hlep + dist-tags + upgrade + udpate + login + add-user + author + home + issues + info + show + find + add + unlink + remove + rm + r + rum + sit + urn + ogr + ), + ], +] +` + +exports[`test/lib/commands/completion.js TAP completion filtered subcommands > filtered subcommands 1`] = ` +Array [ + Array [ + "public", + ], +] +` + +exports[`test/lib/commands/completion.js TAP completion flags > flags 1`] = ` +Array [ + Array [ + String( + --version + --versions + --viewer + --verbose + --v + ), + ], +] +` + +exports[`test/lib/commands/completion.js TAP completion multiple command names > multiple command names 1`] = ` +Array [ + Array [ + String( + adduser + access + audit + add-user + author + add + ), + ], +] +` + +exports[`test/lib/commands/completion.js TAP completion single command name > single command name 1`] = ` +Array [ + Array [ + "config", + ], +] +` + +exports[`test/lib/commands/completion.js TAP completion subcommand completion > subcommands 1`] = ` +Array [ + Array [ + String( + public + restricted + grant + revoke + ls-packages + ls-collaborators + edit + 2fa-required + 2fa-not-required + ), + ], +] +` + +exports[`test/lib/commands/completion.js TAP windows without bash > no output 1`] = ` +Array [] +` |