diff --git a/.changeset/smart-elephants-knock.md b/.changeset/smart-elephants-knock.md new file mode 100644 index 0000000000..7aed10a71e --- /dev/null +++ b/.changeset/smart-elephants-knock.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +The `test` command now ensures that all IO is flushed before exiting when printing `--help`. diff --git a/packages/cli/src/commands/test.ts b/packages/cli/src/commands/test.ts index f1bfcc356b..88769aec1a 100644 --- a/packages/cli/src/commands/test.ts +++ b/packages/cli/src/commands/test.ts @@ -78,6 +78,10 @@ export default async (_opts: OptionValues, cmd: Command) => { process.env.TZ = 'UTC'; } + if (args.includes('--help')) { + (process.stdout as any)._handle.setBlocking(true); + } + // eslint-disable-next-line jest/no-jest-import await require('jest').run(args); };