Skip to content

Commit a64acc0

Browse files
wraithgarlukekarrys
authored andcommitted
fix: really load all commands in tests, add description to birthday
1 parent 45dd8b8 commit a64acc0

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

lib/commands/birthday.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const BaseCommand = require('../base-command.js')
22

33
class Birthday extends BaseCommand {
44
static name = 'birthday'
5+
static description = 'Birthday'
56
static ignoreImplicitWorkspace = true
67
static isShellout = true
78

tap-snapshots/test/lib/load-all-commands.js.test.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ Options:
6868
Run "npm help bin" for more info
6969
`
7070

71+
exports[`test/lib/load-all-commands.js TAP load each command birthday > must match snapshot 1`] = `
72+
Birthday
73+
74+
Usage:
75+
npm birthday
76+
77+
Run "npm help birthday" for more info
78+
`
79+
7180
exports[`test/lib/load-all-commands.js TAP load each command bugs > must match snapshot 1`] = `
7281
Report bugs for a package in a web browser
7382
@@ -348,6 +357,18 @@ alias: hlep
348357
Run "npm help help" for more info
349358
`
350359

360+
exports[`test/lib/load-all-commands.js TAP load each command help-search > must match snapshot 1`] = `
361+
Search npm help documentation
362+
363+
Usage:
364+
npm help-search <text>
365+
366+
Options:
367+
[-l|--long]
368+
369+
Run "npm help help-search" for more info
370+
`
371+
351372
exports[`test/lib/load-all-commands.js TAP load each command hook > must match snapshot 1`] = `
352373
Manage registry hooks
353374

test/lib/load-all-commands.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
const t = require('tap')
66
const util = require('util')
77
const { load: loadMockNpm } = require('../fixtures/mock-npm.js')
8-
const { cmdList } = require('../../lib/utils/cmd-list.js')
8+
const { cmdList, plumbing } = require('../../lib/utils/cmd-list.js')
9+
const allCmds = [...cmdList, ...plumbing]
910

1011
t.test('load each command', async t => {
11-
t.plan(cmdList.length)
12-
for (const cmd of cmdList.sort((a, b) => a.localeCompare(b, 'en'))) {
12+
t.plan(allCmds.length)
13+
for (const cmd of allCmds.sort((a, b) => a.localeCompare(b, 'en'))) {
1314
t.test(cmd, async t => {
1415
const { npm, outputs } = await loadMockNpm(t, {
1516
config: { usage: true },

0 commit comments

Comments
 (0)