Skip to content

Commit

Permalink
test: compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 11, 2023
1 parent 5bf0a2e commit 0728590
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/util/cache-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ export async function cacheCommand(
const args = await cacheArgs(ensureArgObject(cmd.args), respectNoCacheDefault)

const stdProperties = {
aliases: cmd.aliases || [],
aliases: cmd.aliases ?? [],
args,
deprecateAliases: cmd.deprecateAliases,
deprecationOptions: cmd.deprecationOptions,
description: cmd.description,
examples: cmd.examples || (cmd as any).example,
// Support both `examples` and `example` for backwards compatibility.
examples: cmd.examples ?? (cmd as unknown as {example: string}).example,
flags,
hasDynamicHelp: Object.values(flags).some((f) => f.hasDynamicHelp),
hidden: cmd.hidden,
hiddenAliases: cmd.hiddenAliases || [],
hiddenAliases: cmd.hiddenAliases ?? [],
id: cmd.id,
pluginAlias: plugin && plugin.alias,
pluginName: plugin && plugin.name,
Expand Down
2 changes: 2 additions & 0 deletions test/config/config.flexible.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('Config with flexible taxonomy', () => {
flagA: Flags.boolean({char: 'a'}),
},
hidden: false,
hiddenAliases: [],
id: commandIds[0],
async load(): Promise<Command.Class> {
return MyCommandClass
Expand All @@ -74,6 +75,7 @@ describe('Config with flexible taxonomy', () => {
flagB: Flags.boolean({}),
},
hidden: false,
hiddenAliases: [],
id: commandIds[1],
async load(): Promise<Command.Class> {
return MyCommandClass
Expand Down
2 changes: 2 additions & 0 deletions test/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ describe('Config', () => {
args: {},
flags: {},
hidden: false,
hiddenAliases: [],
id: commandIds[0],
async load(): Promise<Command.Class> {
return MyCommandClass
Expand All @@ -264,6 +265,7 @@ describe('Config', () => {
args: {},
flags: {},
hidden: false,
hiddenAliases: [],
id: commandIds[1],
async load(): Promise<Command.Class> {
return MyCommandClass
Expand Down
2 changes: 2 additions & 0 deletions test/util/cache-command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe('cacheCommand', () => {
state: undefined,
description: 'test command',
aliases: ['alias1', 'alias2'],
hiddenAliases: [],
title: 'cmd title',
usage: ['$ usage'],
examples: undefined,
Expand Down Expand Up @@ -193,6 +194,7 @@ describe('cacheCommand', () => {
hidden: undefined,
state: 'beta',
aliases: ['base'],
hiddenAliases: [],
examples: undefined,
deprecationOptions: undefined,
deprecateAliases: undefined,
Expand Down

0 comments on commit 0728590

Please sign in to comment.