From f786e78bf07d4b7115a7937c4c4665a54f978bff Mon Sep 17 00:00:00 2001 From: alin Date: Mon, 21 Oct 2024 14:47:42 +0200 Subject: [PATCH] Change helper, add support for output config and prevent process exit --- .../packages/cli/helpers/makeCliApplication.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/cli/packages/cli/helpers/makeCliApplication.js b/tests/cli/packages/cli/helpers/makeCliApplication.js index 5e392163..2ff7ed1c 100644 --- a/tests/cli/packages/cli/helpers/makeCliApplication.js +++ b/tests/cli/packages/cli/helpers/makeCliApplication.js @@ -1,7 +1,19 @@ import { CliApplication } from "@aedart/cli"; -// TODO: ... -export default function makeCliApplication() +/** + * TODO: + * + * @param {import('commander').OutputConfiguration} [output] + * + * @return {CliApplication} + */ +export default function makeCliApplication(output) { - return new CliApplication(); + const cli = new CliApplication(); + + if (output) { + cli.output(output); + } + + return cli.preventProcessExit(); } \ No newline at end of file