Skip to content

Commit a94b9f5

Browse files
committed
test: fix types
1 parent f9af294 commit a94b9f5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/nuxt-cli/test/unit/help.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import type { CommandDef } from 'citty'
1+
import type { CommandDef, Resolvable } from 'citty'
22

33
import { renderUsage } from 'citty'
44
import { describe, expect, it } from 'vitest'
55

66
import { commands } from '../../src/commands'
77
import { main } from '../../src/main'
88

9-
async function resolve(def: CommandDef): Promise<CommandDef> {
9+
async function resolve(def: Resolvable<CommandDef>): Promise<CommandDef> {
1010
return typeof def === 'function' ? await def() : def
1111
}
1212

13-
async function usage(def: CommandDef, parent?: CommandDef): Promise<string> {
13+
async function usage(def: Resolvable<CommandDef>, parent?: Resolvable<CommandDef>): Promise<string> {
1414
const rendered = await renderUsage(await resolve(def), parent ? await resolve(parent) : undefined)
1515
return rendered.replace(/v\d+\.\d+\.\d[^\s)]*/g, 'v0.0.0')
1616
}
1717

18-
async function subCommand(parent: CommandDef, name: string): Promise<CommandDef> {
18+
async function subCommand(parent: Resolvable<CommandDef>, name: string): Promise<CommandDef> {
1919
const resolved = await resolve(parent)
2020
const subCommands = await (typeof resolved.subCommands === 'function' ? resolved.subCommands() : resolved.subCommands)
2121
return subCommands![name] as CommandDef

0 commit comments

Comments
 (0)