Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
},
"dependencies": {
"@basou/core": "workspace:*",
"commander": "^12.1.0"
"commander": "^14.0.3"
}
}
24 changes: 17 additions & 7 deletions packages/cli/src/commands/approval.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,24 @@ describe("runApprovalReject", () => {
await createApproval(repo, { id: approvalId });
const program = new Command();
registerApprovalCommand(program);
program.exitOverride();
let stderrBuf = "";
program.configureOutput({
writeErr: (msg) => {
stderrBuf += msg;
},
writeOut: () => undefined,
});
// commander 14 stopped propagating `exitOverride()` and `configureOutput()`
// from the parent program to nested subcommands. The missing-required-option
// error is raised on the leaf `approval reject` subcommand, so the same
// overrides have to be re-applied across the whole tree to keep the test
// hermetic (otherwise commander writes to process.stderr and exits the
// worker).
const applyOverrides = (cmd: Command): void => {
cmd.exitOverride();
cmd.configureOutput({
writeErr: (msg) => {
stderrBuf += msg;
},
writeOut: () => undefined,
});
for (const sub of cmd.commands) applyOverrides(sub);
};
applyOverrides(program);
let captured: unknown;
try {
await program.parseAsync(["node", "basou", "approval", "reject", approvalId]);
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.