File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,11 +46,9 @@ afterEach(async () => {
4646} ) ;
4747
4848describe ( 'dispatchSubcommand' , ( ) => {
49- it ( 'throws for unknown subcommand' , async ( ) => {
49+ it ( 'returns false for unknown subcommand' , async ( ) => {
5050 const { dispatchSubcommand } = await import ( './cli.js' ) ;
51- await expect ( dispatchSubcommand ( [ 'node' , 'cli.js' , 'unknown' ] ) ) . rejects . toThrow (
52- 'Unknown subcommand: "unknown"' ,
53- ) ;
51+ expect ( await dispatchSubcommand ( [ 'node' , 'cli.js' , 'unknown' ] ) ) . toBe ( false ) ;
5452 } ) ;
5553
5654 it ( 'returns true and runs add-app-extension for matching subcommand' , async ( ) => {
Original file line number Diff line number Diff line change @@ -120,10 +120,6 @@ export async function dispatchSubcommand(argv: string[]): Promise<boolean> {
120120 return true ;
121121 }
122122
123- if ( subcommand && ! subcommand . startsWith ( '--' ) ) {
124- throw new Error ( `Unknown subcommand: "${ subcommand } ". Available: add-app-extension` ) ;
125- }
126-
127123 return false ;
128124}
129125
You can’t perform that action at this time.
0 commit comments