From 15721c9e75b163bf95ff6371869833f5861a6f0b Mon Sep 17 00:00:00 2001 From: Gar Date: Fri, 14 May 2021 07:04:04 -0700 Subject: [PATCH] chore(tests): tie usage output to snapshots We have another PR in flight that will start auto-generating some content in `docs/content/commands`, and will run `postsnap`, which means that if we tie the usage output to a snapshot, the docs will also be updated when the snapshots change. --- .../test/lib/load-all-commands.js.test.cjs | 938 ++++++++++++++++++ test/lib/load-all-commands.js | 5 +- 2 files changed, 942 insertions(+), 1 deletion(-) create mode 100644 tap-snapshots/test/lib/load-all-commands.js.test.cjs diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs new file mode 100644 index 0000000000000..f018d8c823cfe --- /dev/null +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -0,0 +1,938 @@ +/* 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/load-all-commands.js TAP load each command access > must match snapshot 1`] = ` +npm access + +Set access level on published packages + +Usage: +npm access public [] +npm access restricted [] +npm access grant [] +npm access revoke [] +npm access 2fa-required [] +npm access 2fa-not-required [] +npm access ls-packages [||] +npm access ls-collaborators [ []] +npm access edit [] + +Run "npm help access" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command adduser > must match snapshot 1`] = ` +npm adduser + +Add a registry user account + +Usage: +npm adduser + +Options: +[--registry ] [--scope <@scope>] + +aliases: login, add-user + +Run "npm help adduser" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command audit > must match snapshot 1`] = ` +npm audit + +Run a security audit + +Usage: +npm audit [fix] + +Options: +[--audit-level ] [--dry-run] [-f|--force] +[--json] [--package-lock-only] [--production] + +Run "npm help audit" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command bin > must match snapshot 1`] = ` +npm bin + +Display npm bin folder + +Usage: +npm bin + +Options: +[-g|--global] + +Run "npm help bin" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command bugs > must match snapshot 1`] = ` +npm bugs + +Report bugs for a package in a web browser + +Usage: +npm bugs [] + +alias: issues + +Run "npm help bugs" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command cache > must match snapshot 1`] = ` +npm cache + +Manipulates packages cache + +Usage: +npm cache add +npm cache add +npm cache add +npm cache add +npm cache add @ +npm cache clean +npm cache verify + +Run "npm help cache" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command ci > must match snapshot 1`] = ` +npm ci + +Install a project with a clean slate + +Usage: +npm ci + +aliases: clean-install, ic, install-clean, isntall-clean + +Run "npm help ci" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command completion > must match snapshot 1`] = ` +npm completion + +Tab Completion for npm + +Usage: +npm completion + +Run "npm help completion" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command config > must match snapshot 1`] = ` +npm config + +Manage the npm configuration files + +Usage: +npm config set = [= ...] +npm config get [ [ ...]] +npm config delete [ ...] +npm config list [--json] +npm config edit + +alias: c + +Run "npm help config" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command dedupe > must match snapshot 1`] = ` +npm dedupe + +Reduce duplication in the package tree + +Usage: +npm dedupe + +alias: ddp + +Run "npm help dedupe" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command deprecate > must match snapshot 1`] = ` +npm deprecate + +Deprecate a version of a package + +Usage: +npm deprecate [@] + +Run "npm help deprecate" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command diff > must match snapshot 1`] = ` +npm diff + +The registry diff command + +Usage: +npm diff [...] +npm diff --diff= [...] +npm diff --diff= [--diff=] [...] +npm diff --diff= [--diff=] [...] +npm diff [--diff-ignore-all-space] [--diff-name-only] [...] [...] + +Run "npm help diff" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command dist-tag > must match snapshot 1`] = ` +npm dist-tag + +Modify package distribution tags + +Usage: +npm dist-tag add @ [] +npm dist-tag rm +npm dist-tag ls [] + +Options: +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +alias: dist-tags + +Run "npm help dist-tag" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command docs > must match snapshot 1`] = ` +npm docs + +Open documentation for a package in a web browser + +Usage: +npm docs [ [ ...]] + +Options: +[--browser|--browser ] [--registry ] +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +alias: home + +Run "npm help docs" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command doctor > must match snapshot 1`] = ` +npm doctor + +Check your npm environment + +Usage: +npm doctor + +Run "npm help doctor" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command edit > must match snapshot 1`] = ` +npm edit + +Edit an installed package + +Usage: +npm edit [/...] + +Run "npm help edit" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command exec > must match snapshot 1`] = ` +npm exec + +Run a command from a local or remote npm package + +Usage: +npm exec -- [@] [args...] +npm exec --package=[@] -- [args...] +npm exec -c ' [args...]' +npm exec --package=foo -c ' [args...]' + +Options: +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +alias: x + +Run "npm help exec" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command explain > must match snapshot 1`] = ` +npm explain + +Explain installed packages + +Usage: +npm explain + +alias: why + +Run "npm help explain" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command explore > must match snapshot 1`] = ` +npm explore + +Browse an installed package + +Usage: +npm explore [ -- ] + +Run "npm help explore" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command find-dupes > must match snapshot 1`] = ` +npm find-dupes + +Find duplication in the package tree + +Usage: +npm find-dupes + +Run "npm help find-dupes" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command fund > must match snapshot 1`] = ` +npm fund + +Retrieve funding information + +Usage: +npm fund [[<@scope>/]] + +Options: +[--json] [--browser|--browser ] [--unicode] +[--which ] + +Run "npm help fund" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command get > must match snapshot 1`] = ` +npm get + +Get a value from the npm configuration + +Usage: +npm get [ ...] (See \`npm config\`) + +Run "npm help get" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command help > must match snapshot 1`] = ` +npm help + +Get help on npm + +Usage: +npm help [] + +alias: hlep + +Run "npm help help" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command hook > must match snapshot 1`] = ` +npm hook + +Manage registry hooks + +Usage: +npm hook add [--type=] +npm hook ls [pkg] +npm hook rm +npm hook update + +Run "npm help hook" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command init > must match snapshot 1`] = ` +npm init + +Create a package.json file + +Usage: +npm init [--force|-f|--yes|-y|--scope] +npm init <@scope> (same as \`npx <@scope>/create\`) +npm init [<@scope>/] (same as \`npx [<@scope>/]create-\`) + +Options: +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +aliases: create, innit + +Run "npm help init" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command install > must match snapshot 1`] = ` +npm install + +Install a package + +Usage: +npm install [<@scope>/] +npm install [<@scope>/]@ +npm install [<@scope>/]@ +npm install [<@scope>/]@ +npm install @npm: +npm install +npm install +npm install +npm install +npm install / + +Options: +[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer] +[-E|--save-exact] + +aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add + +Run "npm help install" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command install-ci-test > must match snapshot 1`] = ` +npm install-ci-test + +Install a project with a clean slate and run tests + +Usage: +npm install-ci-test + +alias: cit + +Run "npm help install-ci-test" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command install-test > must match snapshot 1`] = ` +npm install-test + +Install package(s) and run tests + +Usage: +npm install-test [<@scope>/] +npm install-test [<@scope>/]@ +npm install-test [<@scope>/]@ +npm install-test [<@scope>/]@ +npm install-test @npm: +npm install-test +npm install-test +npm install-test +npm install-test +npm install-test / + +Options: +[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer] +[-E|--save-exact] + +alias: it + +Run "npm help install-test" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command link > must match snapshot 1`] = ` +npm link + +Symlink a package folder + +Usage: +npm link (in package dir) +npm link [<@scope>/][@] + +alias: ln + +Run "npm help link" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command ll > must match snapshot 1`] = ` +npm ll + +List installed packages + +Usage: +npm ll [[<@scope>/] ...] + +alias: la + +Run "npm help ll" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command login > must match snapshot 1`] = ` +npm adduser + +Add a registry user account + +Usage: +npm adduser + +Options: +[--registry ] [--scope <@scope>] + +aliases: login, add-user + +Run "npm help adduser" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command logout > must match snapshot 1`] = ` +npm logout + +Log out of the registry + +Usage: +npm logout + +Options: +[--registry ] [--scope <@scope>] + +Run "npm help logout" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command ls > must match snapshot 1`] = ` +npm ls + +List installed packages + +Usage: +npm ls npm ls [[<@scope>/] ...] + +alias: list + +Run "npm help ls" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command org > must match snapshot 1`] = ` +npm org + +Manage orgs + +Usage: +npm org set orgname username [developer | admin | owner] +npm org rm orgname username +npm org ls orgname [] + +alias: ogr + +Run "npm help org" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command outdated > must match snapshot 1`] = ` +npm outdated + +Check for outdated packages + +Usage: +npm outdated [[<@scope>/] ...] + +Run "npm help outdated" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command owner > must match snapshot 1`] = ` +npm owner + +Manage package owners + +Usage: +npm owner add [<@scope>/] +npm owner rm [<@scope>/] +npm owner ls [<@scope>/] + +alias: author + +Run "npm help owner" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command pack > must match snapshot 1`] = ` +npm pack + +Create a tarball from a package + +Usage: +npm pack [[<@scope>/]...] + +Options: +[--dry-run] +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +Run "npm help pack" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command ping > must match snapshot 1`] = ` +npm ping + +Ping npm registry + +Usage: +npm ping + +Options: +[--registry ] + +Run "npm help ping" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command prefix > must match snapshot 1`] = ` +npm prefix + +Display prefix + +Usage: +npm prefix [-g] + +Run "npm help prefix" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command profile > must match snapshot 1`] = ` +npm profile + +Change settings on your registry profile + +Usage: +npm profile enable-2fa [auth-only|auth-and-writes] +npm profile disable-2fa +npm profile get [] +npm profile set + +Run "npm help profile" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command prune > must match snapshot 1`] = ` +npm prune + +Remove extraneous packages + +Usage: +npm prune [[<@scope>/]...] + +Options: +[--production] + +Run "npm help prune" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command publish > must match snapshot 1`] = ` +npm publish + +Publish a package + +Usage: +npm publish [] + +Options: +[--tag ] [--access ] [--dry-run] + +Run "npm help publish" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command rebuild > must match snapshot 1`] = ` +npm rebuild + +Rebuild a package + +Usage: +npm rebuild [[<@scope>/][@] ...] + +alias: rb + +Run "npm help rebuild" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command repo > must match snapshot 1`] = ` +npm repo + +Open package repository page in the browser + +Usage: +npm repo [ [ ...]] + +Options: +[--browser|--browser ] +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +Run "npm help repo" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command restart > must match snapshot 1`] = ` +npm restart + +Restart a package + +Usage: +npm restart [-- ] + +Run "npm help restart" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command root > must match snapshot 1`] = ` +npm root + +Display npm root + +Usage: +npm root + +Options: +[-g|--global] + +Run "npm help root" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command run-script > must match snapshot 1`] = ` +npm run-script + +Run arbitrary package scripts + +Usage: +npm run-script [-- ] + +Options: +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] + +aliases: run, rum, urn + +Run "npm help run-script" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command search > must match snapshot 1`] = ` +npm search + +Search for pacakges + +Usage: +npm search [search terms ...] + +Options: +[-l|--long] [--json] [-p|--parseable] [--no-description] + +aliases: s, se, find + +Run "npm help search" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command set > must match snapshot 1`] = ` +npm set + +Set a value in the npm configuration + +Usage: +npm set = [= ...] (See \`npm config\`) + +Run "npm help set" for more info +` + +exports[`test/lib/load-all-commands.js TAP load each command set-script > must match snapshot 1`] = ` +npm set-script + +Set tasks in the scripts section of package.json + +Usage: +npm set-script [