Merge pull request #32583 from Believe-SA/commander-14
chore: update dependency commander to v14
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
"buffer": "^6.0.3",
|
||||
"chalk": "^4.0.0",
|
||||
"chokidar": "^3.3.1",
|
||||
"commander": "^12.0.0",
|
||||
"commander": "^14.0.3",
|
||||
"cross-fetch": "^4.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"css-loader": "^6.5.1",
|
||||
|
||||
@@ -29,10 +29,10 @@ jest.mock('./paths', () => ({
|
||||
}));
|
||||
|
||||
describe('findRoleFromCommand', () => {
|
||||
function mkCommand(args: string) {
|
||||
function mkCommand(args?: string) {
|
||||
const parsed = new Command()
|
||||
.option('--role <role>', 'test role')
|
||||
.parse(['node', 'entry.js', ...args.split(' ')]) as Command;
|
||||
.parse(args?.split(' ') ?? [], { from: 'user' });
|
||||
return parsed.opts();
|
||||
}
|
||||
|
||||
@@ -48,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',
|
||||
);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export default createCliPlugin({
|
||||
execute: async ({ args }) => {
|
||||
const command = new Command();
|
||||
command.allowUnknownOption(true);
|
||||
command.allowExcessArguments(true);
|
||||
command.option(
|
||||
'--since <ref>',
|
||||
'Only test packages that changed since the specified ref',
|
||||
@@ -53,7 +54,8 @@ export default createCliPlugin({
|
||||
const command = new Command();
|
||||
|
||||
command.allowUnknownOption(true);
|
||||
command.helpOption(', --backstage-cli-help');
|
||||
command.allowExcessArguments(true);
|
||||
command.helpOption('--backstage-cli-help');
|
||||
command.action(
|
||||
lazy(() => import('./commands/package/test'), 'default'),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user