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:
authorGar <gar+gh@danger.computer>2022-03-24 01:20:51 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-03-28 23:21:36 +0300
commita64acc0bf01e4bc68b26ead5b2d5c6db47ef16c2 (patch)
tree8ad35c6b33cbcdaec656a9f7a7a8af9675dc08a9
parent45dd8b8615bb1d7a93e1733746581049a1f399e6 (diff)
fix: really load all commands in tests, add description to birthday
-rw-r--r--lib/commands/birthday.js1
-rw-r--r--tap-snapshots/test/lib/load-all-commands.js.test.cjs21
-rw-r--r--test/lib/load-all-commands.js7
3 files changed, 26 insertions, 3 deletions
diff --git a/lib/commands/birthday.js b/lib/commands/birthday.js
index d8305cf8d..c7b5b31c5 100644
--- a/lib/commands/birthday.js
+++ b/lib/commands/birthday.js
@@ -2,6 +2,7 @@ const BaseCommand = require('../base-command.js')
class Birthday extends BaseCommand {
static name = 'birthday'
+ static description = 'Birthday'
static ignoreImplicitWorkspace = true
static isShellout = true
diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs
index 66c48983a..550c59613 100644
--- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs
+++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs
@@ -68,6 +68,15 @@ Options:
Run "npm help bin" for more info
`
+exports[`test/lib/load-all-commands.js TAP load each command birthday > must match snapshot 1`] = `
+Birthday
+
+Usage:
+npm birthday
+
+Run "npm help birthday" for more info
+`
+
exports[`test/lib/load-all-commands.js TAP load each command bugs > must match snapshot 1`] = `
Report bugs for a package in a web browser
@@ -348,6 +357,18 @@ alias: hlep
Run "npm help help" for more info
`
+exports[`test/lib/load-all-commands.js TAP load each command help-search > must match snapshot 1`] = `
+Search npm help documentation
+
+Usage:
+npm help-search <text>
+
+Options:
+[-l|--long]
+
+Run "npm help help-search" for more info
+`
+
exports[`test/lib/load-all-commands.js TAP load each command hook > must match snapshot 1`] = `
Manage registry hooks
diff --git a/test/lib/load-all-commands.js b/test/lib/load-all-commands.js
index ec1957529..34773bba0 100644
--- a/test/lib/load-all-commands.js
+++ b/test/lib/load-all-commands.js
@@ -5,11 +5,12 @@
const t = require('tap')
const util = require('util')
const { load: loadMockNpm } = require('../fixtures/mock-npm.js')
-const { cmdList } = require('../../lib/utils/cmd-list.js')
+const { cmdList, plumbing } = require('../../lib/utils/cmd-list.js')
+const allCmds = [...cmdList, ...plumbing]
t.test('load each command', async t => {
- t.plan(cmdList.length)
- for (const cmd of cmdList.sort((a, b) => a.localeCompare(b, 'en'))) {
+ t.plan(allCmds.length)
+ for (const cmd of allCmds.sort((a, b) => a.localeCompare(b, 'en'))) {
t.test(cmd, async t => {
const { npm, outputs } = await loadMockNpm(t, {
config: { usage: true },