fix: Revert some un-necessary allowExcessArguments

Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
Gabriel Dugny
2026-02-16 17:38:48 +01:00
parent de62a9d322
commit e6f7ab105d
2 changed files with 3 additions and 7 deletions
+3 -4
View File
@@ -29,11 +29,10 @@ jest.mock('./paths', () => ({
}));
describe('findRoleFromCommand', () => {
function mkCommand(args: string) {
function mkCommand(args?: string) {
const parsed = new Command()
.allowExcessArguments(true)
.option('--role <role>', 'test role')
.parse(['node', 'entry.js', ...args.split(' ')]) as Command;
.parse(args?.split(' ') ?? [], { from: 'user' });
return parsed.opts();
}
@@ -49,7 +48,7 @@ describe('findRoleFromCommand', () => {
});
it('provides role info by role', async () => {
await expect(findRoleFromCommand(mkCommand(''))).resolves.toEqual(
await expect(findRoleFromCommand(mkCommand())).resolves.toEqual(
'web-library',
);