You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/cli/cli.spec.ts
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -334,6 +334,18 @@ describe('cli', () => {
334
334
assert(cliLogStub.calledWith(`CLI for Microsoft 365 v${packageJSON.version}`));
335
335
});
336
336
337
+
it('shows message that command cannot be found when an unknown command is entered',async()=>{
338
+
constcommandName='unknown';
339
+
awaitcli.execute([commandName]);
340
+
assert(cliErrorStub.calledWith(chalk.red(`Command '${cli.currentCommandName}' was not found. Below you can find the commands and command groups you can use. For detailed information on a command group, use 'm365 [command group] --help'.`)));
341
+
});
342
+
343
+
it('does not show message that command cannot be found when a uncompleted command is entered',async()=>{
344
+
constcommandName='cli mock';
345
+
awaitcli.execute([commandName]);
346
+
assert(cliErrorStub.notCalled);
347
+
});
348
+
337
349
it('exits with 0 code when no command specified',async()=>{
awaitcli.error(chalk.red(`Command '${cli.currentCommandName}' was not found. Below you can find the commands and command groups you can use. For detailed information on a command group, use 'm365 [command group] --help'.`));
666
+
}
667
+
663
668
cli.log();
664
669
cli.log(`CLI for Microsoft 365 v${app.packageJson().version}`);
0 commit comments