Skip to content

Commit

Permalink
Fix test where CLI output is cutoff at 8192 bytes (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Sep 19, 2023
1 parent e77ae01 commit a195a78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/options/cliArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ export function getOptionsFromCliArgs(processArgs: readonly string[]) {

.alias('version', 'v')
.help()
.exitProcess(!processArgs.includes('--noExitProcess'))

.epilogue(
'For bugs, feature requests or questions: https://github.com/sqren/backport/issues\nOr contact me directly: https://twitter.com/sorenlouv',
Expand Down
13 changes: 10 additions & 3 deletions src/test/e2e/cli/entrypoint.cli.private.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ describe('entrypoint cli', () => {
});

it('--help', async () => {
const { output } = await runBackportViaCli([`--help`]);
const [help] = output.split('--help');
const { output } = await runBackportViaCli([`--help`, '--noExitProcess'], {
waitForString: 'Or contact me directly',
});

const [help] = output.split('https://twitter.com/sorenlouv');

expect(help).toMatchInlineSnapshot(`
"entrypoint.cli.ts [args]
Expand Down Expand Up @@ -118,7 +122,10 @@ Options:
--targetBranchChoice List branches to backport to [array]
-l, --targetPRLabel, --label Add labels to the target (backport) PR [array]
--verify Opposite of no-verify [boolean]
"
--help Show help [boolean]
For bugs, feature requests or questions: https://github.com/sqren/backport/issues
Or contact me directly: "
`);
});

Expand Down

0 comments on commit a195a78

Please sign in to comment.