Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-02-01 23:34:05 +0300
committerisaacs <i@izs.me>2021-02-01 23:42:06 +0300
commit8c5ca2f516f5ac87f3bbd7f1fd95c0b283a21f14 (patch)
tree762fcc67e7958778f7d3a4a705c44bc2bab595f7 /tap-snapshots
parent13a5e31781cdaa37d3f007e1c8583c7cb591c62a (diff)
test: Add test for npm-usage.js, and fix 'npm --long' output
Diffstat (limited to 'tap-snapshots')
-rw-r--r--tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js495
1 files changed, 495 insertions, 0 deletions
diff --git a/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
new file mode 100644
index 000000000..72c2c8158
--- /dev/null
+++ b/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
@@ -0,0 +1,495 @@
+/* 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/utils/npm-usage.js TAP basic usage > must match snapshot 1`] = `
+
+Usage: npm <command>
+
+npm install install all the dependencies in your project
+npm install <foo> add the <foo> dependency to your project
+npm test run this project's tests
+npm run <foo> run the script named <foo>
+npm <command> -h quick help on <command>
+npm -l display usage info for all commands
+npm help <term> search for help on <term>
+npm help npm more involved overview
+
+All commands:
+
+ access, adduser, audit, bin, bugs, cache, ci, completion,
+ config, dedupe, deprecate, diff, dist-tag, docs, doctor,
+ edit, exec, explain, explore, find-dupes, fund, get, help,
+ hook, init, install, install-ci-test, install-test, link,
+ ll, login, logout, ls, org, outdated, owner, pack, ping,
+ prefix, profile, prune, publish, rebuild, repo, restart,
+ root, run-script, search, set, set-script, shrinkwrap, star,
+ stars, start, stop, team, test, token, uninstall, unpublish,
+ unstar, update, version, view, whoami
+
+Specify configs in the ini-formatted file:
+ /some/config/file/.npmrc
+or on the command line via: npm <command> --key=value
+
+More configuration info: npm help config
+Configuration fields: npm help 7 config
+
+npm@7.99.9999 {BASEDIR}
+
+`
+
+exports[`test/lib/utils/npm-usage.js TAP did you mean? > must match snapshot 1`] = `
+
+Usage: npm <command>
+
+npm install install all the dependencies in your project
+npm install <foo> add the <foo> dependency to your project
+npm test run this project's tests
+npm run <foo> run the script named <foo>
+npm <command> -h quick help on <command>
+npm -l display usage info for all commands
+npm help <term> search for help on <term>
+npm help npm more involved overview
+
+All commands:
+
+ access, adduser, audit, bin, bugs, cache, ci, completion,
+ config, dedupe, deprecate, diff, dist-tag, docs, doctor,
+ edit, exec, explain, explore, find-dupes, fund, get, help,
+ hook, init, install, install-ci-test, install-test, link,
+ ll, login, logout, ls, org, outdated, owner, pack, ping,
+ prefix, profile, prune, publish, rebuild, repo, restart,
+ root, run-script, search, set, set-script, shrinkwrap, star,
+ stars, start, stop, team, test, token, uninstall, unpublish,
+ unstar, update, version, view, whoami
+
+Specify configs in the ini-formatted file:
+ /some/config/file/.npmrc
+or on the command line via: npm <command> --key=value
+
+More configuration info: npm help config
+Configuration fields: npm help 7 config
+
+npm@7.99.9999 {BASEDIR}
+
+`
+
+exports[`test/lib/utils/npm-usage.js TAP did you mean? > must match snapshot 2`] = `
+
+Did you mean one of these?
+ install
+ uninstall
+`
+
+exports[`test/lib/utils/npm-usage.js TAP set process.stdout.columns columns=0 > must match snapshot 1`] = `
+
+Usage: npm <command>
+
+npm install install all the dependencies in your project
+npm install <foo> add the <foo> dependency to your project
+npm test run this project's tests
+npm run <foo> run the script named <foo>
+npm <command> -h quick help on <command>
+npm -l display usage info for all commands
+npm help <term> search for help on <term>
+npm help npm more involved overview
+
+All commands:
+
+ access, adduser, audit, bin, bugs, cache, ci, completion,
+ config, dedupe, deprecate, diff, dist-tag, docs, doctor,
+ edit, exec, explain, explore, find-dupes, fund, get, help,
+ hook, init, install, install-ci-test, install-test, link,
+ ll, login, logout, ls, org, outdated, owner, pack, ping,
+ prefix, profile, prune, publish, rebuild, repo, restart,
+ root, run-script, search, set, set-script, shrinkwrap, star,
+ stars, start, stop, team, test, token, uninstall, unpublish,
+ unstar, update, version, view, whoami
+
+Specify configs in the ini-formatted file:
+ /some/config/file/.npmrc
+or on the command line via: npm <command> --key=value
+
+More configuration info: npm help config
+Configuration fields: npm help 7 config
+
+npm@7.99.9999 {BASEDIR}
+
+`
+
+exports[`test/lib/utils/npm-usage.js TAP set process.stdout.columns columns=90 > must match snapshot 1`] = `
+
+Usage: npm <command>
+
+npm install install all the dependencies in your project
+npm install <foo> add the <foo> dependency to your project
+npm test run this project's tests
+npm run <foo> run the script named <foo>
+npm <command> -h quick help on <command>
+npm -l display usage info for all commands
+npm help <term> search for help on <term>
+npm help npm more involved overview
+
+All commands:
+
+ access, adduser, audit, bin, bugs, cache, ci, completion,
+ config, dedupe, deprecate, diff, dist-tag, docs, doctor,
+ edit, exec, explain, explore, find-dupes, fund, get, help,
+ hook, init, install, install-ci-test, install-test, link,
+ ll, login, logout, ls, org, outdated, owner, pack, ping,
+ prefix, profile, prune, publish, rebuild, repo, restart,
+ root, run-script, search, set, set-script, shrinkwrap, star,
+ stars, start, stop, team, test, token, uninstall, unpublish,
+ unstar, update, version, view, whoami
+
+Specify configs in the ini-formatted file:
+ /some/config/file/.npmrc
+or on the command line via: npm <command> --key=value
+
+More configuration info: npm help config
+Configuration fields: npm help 7 config
+
+npm@7.99.9999 {BASEDIR}
+
+`
+
+exports[`test/lib/utils/npm-usage.js TAP with browser > must match snapshot 1`] = `
+
+Usage: npm <command>
+
+npm install install all the dependencies in your project
+npm install <foo> add the <foo> dependency to your project
+npm test run this project's tests
+npm run <foo> run the script named <foo>
+npm <command> -h quick help on <command>
+npm -l display usage info for all commands
+npm help <term> search for help on <term> (in a browser)
+npm help npm more involved overview (in a browser)
+
+All commands:
+
+ access, adduser, audit, bin, bugs, cache, ci, completion,
+ config, dedupe, deprecate, diff, dist-tag, docs, doctor,
+ edit, exec, explain, explore, find-dupes, fund, get, help,
+ hook, init, install, install-ci-test, install-test, link,
+ ll, login, logout, ls, org, outdated, owner, pack, ping,
+ prefix, profile, prune, publish, rebuild, repo, restart,
+ root, run-script, search, set, set-script, shrinkwrap, star,
+ stars, start, stop, team, test, token, uninstall, unpublish,
+ unstar, update, version, view, whoami
+
+Specify configs in the ini-formatted file:
+ /some/config/file/.npmrc
+or on the command line via: npm <command> --key=value
+
+More configuration info: npm help config
+Configuration fields: npm help 7 config
+
+npm@7.99.9999 {BASEDIR}
+
+`
+
+exports[`test/lib/utils/npm-usage.js TAP with long > must match snapshot 1`] = `
+
+Usage: npm <command>
+
+npm install install all the dependencies in your project
+npm install <foo> add the <foo> dependency to your project
+npm test run this project's tests
+npm run <foo> run the script named <foo>
+npm <command> -h quick help on <command>
+npm -l display usage info for all commands
+npm help <term> search for help on <term>
+npm help npm more involved overview
+
+All commands:
+
+ access npm access public [<package>]
+ npm access restricted [<package>]
+ npm access grant <read-only|read-write> <scope:team> [<package>]
+ npm access revoke <scope:team> [<package>]
+ npm access 2fa-required [<package>]
+ npm access 2fa-not-required [<package>]
+ npm access ls-packages [<user>|<scope>|<scope:team>]
+ npm access ls-collaborators [<package> [<user>]]
+ npm access edit [<package>]
+
+ adduser npm adduser [--registry=url] [--scope=@orgname] [--always-auth]
+
+ aliases: login, add-user
+
+ audit npm audit [--json] [--production]
+ npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]
+
+ bin npm bin [-g]
+
+ bugs npm bugs [<pkgname>]
+
+ alias: issues
+
+ cache npm cache add <tarball file>
+ npm cache add <folder>
+ npm cache add <tarball url>
+ npm cache add <git url>
+ npm cache add <name>@<version>
+ npm cache clean
+ npm cache verify
+
+ ci npm ci
+
+ aliases: clean-install, ic, install-clean, isntall-clean
+
+ completion source <(npm completion)
+
+ config npm config set <key>=<value> [<key>=<value> ...]
+ npm config get [<key> [<key> ...]]
+ npm config delete <key> [<key> ...]
+ npm config list [--json]
+ npm config edit
+ npm set <key>=<value> [<key>=<value> ...]
+ npm get [<key> [<key> ...]]
+
+ alias: c
+
+ dedupe npm dedupe
+
+ alias: ddp
+
+ deprecate npm deprecate <pkg>[@<version>] <message>
+
+ diff npm diff [...<paths>]
+ npm diff --diff=<pkg-name> [...<paths>]
+ npm diff --diff=<version-a> [--diff=<version-b>] [...<paths>]
+ npm diff --diff=<spec-a> [--diff=<spec-b>] [...<paths>]
+ npm diff [--diff-ignore-all-space] [--diff-name-only] [...<paths>] [...<paths>]
+
+ dist-tag npm dist-tag add <pkg>@<version> [<tag>]
+ npm dist-tag rm <pkg> <tag>
+ npm dist-tag ls [<pkg>]
+
+ alias: dist-tags
+
+ docs npm docs [<pkgname> [<pkgname> ...]]
+
+ alias: home
+
+ doctor npm doctor
+
+ edit npm edit <pkg>[/<subpkg>...]
+
+ exec Run a command from a local or remote npm package.
+
+ npm exec -- <pkg>[@<version>] [args...]
+ npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
+ npm exec -c '<cmd> [args...]'
+ npm exec --package=foo -c '<cmd> [args...]'
+
+ npx <pkg>[@<specifier>] [args...]
+ npx -p <pkg>[@<specifier>] <cmd> [args...]
+ npx -c '<cmd> [args...]'
+ npx -p <pkg>[@<specifier>] -c '<cmd> [args...]'
+ Run without --call or positional args to open interactive subshell
+
+
+ alias: x
+ common options:
+ --package=<pkg> (may be specified multiple times)
+ -p is a shorthand for --package only when using npx executable
+ -c <cmd> --call=<cmd> (may not be mixed with positional arguments)
+
+ explain npm explain <folder | specifier>
+
+ alias: why
+
+ explore npm explore <pkg> [ -- <command>]
+
+ find-dupes npm find-dupes
+
+ fund npm fund
+
+ common options: npm fund [--json] [--browser] [--unicode] [[<@scope>/]<pkg> [--which=<fundingSourceNumber>]
+
+ get npm get [<key> ...] (See \`npm config\`)
+
+ help npm help <term> [<terms..>]
+
+ alias: hlep
+
+ hook npm hook add <pkg> <url> <secret> [--type=<type>]
+ npm hook ls [pkg]
+ npm hook rm <id>
+ npm hook update <id> <url> <secret>
+
+ init
+ npm init [--force|-f|--yes|-y|--scope]
+ npm init <@scope> (same as \`npx <@scope>/create\`)
+ npm init [<@scope>/]<name> (same as \`npx [<@scope>/]create-<name>\`)
+
+ aliases: create, innit
+
+ install npm install (with no args, in package dir)
+ npm install [<@scope>/]<pkg>
+ npm install [<@scope>/]<pkg>@<tag>
+ npm install [<@scope>/]<pkg>@<version>
+ npm install [<@scope>/]<pkg>@<version range>
+ npm install <alias>@npm:<name>
+ npm install <folder>
+ npm install <tarball file>
+ npm install <tarball url>
+ npm install <git:// url>
+ npm install <github username>/<github project>
+
+ aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add
+ common options: [--save-prod|--save-dev|--save-optional|--save-peer] [--save-exact] [--no-save]
+
+ install-ci-test npm install-ci-test [args]
+ Same args as \`npm ci\`
+
+ alias: cit
+
+ install-test npm install-test [args]
+ Same args as \`npm install\`
+
+ alias: it
+
+ link npm link (in package dir)
+ npm link [<@scope>/]<pkg>[@<version>]
+
+ alias: ln
+
+ ll npm ls [[<@scope>/]<pkg> ...]
+
+ alias: list
+
+ login npm adduser [--registry=url] [--scope=@orgname] [--always-auth]
+
+ aliases: login, add-user
+
+ logout npm logout [--registry=<url>] [--scope=<@scope>]
+
+ ls npm ls [[<@scope>/]<pkg> ...]
+
+ alias: list
+
+ org npm org set orgname username [developer | admin | owner]
+ npm org rm orgname username
+ npm org ls orgname [<username>]
+
+ outdated npm outdated [[<@scope>/]<pkg> ...]
+
+ owner npm owner add <user> [<@scope>/]<pkg>
+ npm owner rm <user> [<@scope>/]<pkg>
+ npm owner ls [<@scope>/]<pkg>
+
+ alias: author
+
+ pack npm pack [[<@scope>/]<pkg>...] [--dry-run]
+
+ ping npm ping
+ ping registry
+
+ prefix npm prefix [-g]
+
+ profile npm profile disable-2fa
+
+
+ common options: npm profile get [<key>]
+
+
+ prune npm prune [[<@scope>/]<pkg>...] [--production]
+
+ publish npm publish [<folder>] [--tag <tag>] [--access <public|restricted>] [--dry-run]
+
+ Publishes '.' if no argument supplied
+ Sets tag \`latest\` if no --tag specified
+
+ rebuild npm rebuild [[<@scope>/]<name>[@<version>] ...]
+
+ alias: rb
+
+ repo npm repo [<pkgname> [<pkgname> ...]]
+
+ restart npm restart [-- <args>]
+
+ root npm root [-g]
+
+ run-script npm run-script <command> [-- <args>]
+
+ aliases: run, rum, urn
+
+ search npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
+
+ aliases: s, se, find
+
+ set npm set <key>=<value> [<key>=<value> ...] (See \`npm config\`)
+
+ set-script npm set-script [<script>] [<command>]
+
+ shrinkwrap npm shrinkwrap
+
+ star npm star [<pkg>...]
+ npm unstar [<pkg>...]
+
+ stars npm stars [<user>]
+
+ start npm start [-- <args>]
+
+ stop npm stop [-- <args>]
+
+ team npm team create <scope:team> [--otp <otpcode>]
+ npm team destroy <scope:team> [--otp <otpcode>]
+ npm team add <scope:team> <user> [--otp <otpcode>]
+ npm team rm <scope:team> <user> [--otp <otpcode>]
+ npm team ls <scope>|<scope:team>
+
+
+ test npm test [-- <args>]
+
+ aliases: tst, t
+
+ token npm token list
+ npm token revoke <id|token>
+ npm token create [--read-only] [--cidr=list]
+
+ uninstall npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|--no-save]
+
+ aliases: un, unlink, remove, rm, r
+
+ unpublish npm unpublish [<@scope>/]<pkg>[@<version>]
+
+ unstar npm star [<pkg>...]
+ npm unstar [<pkg>...]
+
+ update npm update [-g] [<pkg>...]
+
+ aliases: up, upgrade, udpate
+
+ version npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
+ (run in package dir)
+
+ 'npm -v' or 'npm --version' to print npm version (7.5.0)
+ 'npm view <pkg> version' to view a package's published version
+ 'npm ls' to inspect current package/dependency versions
+
+ alias: verison
+
+ view npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]
+
+ aliases: v, info, show
+
+ whoami npm whoami [--registry <registry>]
+ (just prints username according to given registry)
+
+Specify configs in the ini-formatted file:
+ /some/config/file/.npmrc
+or on the command line via: npm <command> --key=value
+
+More configuration info: npm help config
+Configuration fields: npm help 7 config
+
+npm@7.99.9999 {BASEDIR}
+
+`