From 25a52c397bde8dc951955d4640bb15e56ea2e34b Mon Sep 17 00:00:00 2001 From: timbrinded <79199034+timbrinded@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:54:30 +0000 Subject: [PATCH] force exit --- .changeset/silver-peaches-lie.md | 5 +++++ packages/cli/src/cmds/entrypoint.ts | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/silver-peaches-lie.md diff --git a/.changeset/silver-peaches-lie.md b/.changeset/silver-peaches-lie.md new file mode 100644 index 00000000..e6867eca --- /dev/null +++ b/.changeset/silver-peaches-lie.md @@ -0,0 +1,5 @@ +--- +"@moonwall/cli": patch +--- + +Force exit on failure diff --git a/packages/cli/src/cmds/entrypoint.ts b/packages/cli/src/cmds/entrypoint.ts index 91373ee6..0ca5b550 100755 --- a/packages/cli/src/cmds/entrypoint.ts +++ b/packages/cli/src/cmds/entrypoint.ts @@ -104,9 +104,13 @@ yargs(hideBin(process.argv)) async (args) => { if (args.envName) { process.env.MOON_RUN_SCRIPTS = "true"; - (await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest })) - ? process.exit(0) - : process.exit(1); + if (await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest })) { + console.log("✅ All tests passed"); + process.exit(0); + } else { + console.log("❌ Some tests failed"); + process.kill(process.pid, 'SIGTERM'); + } } else { console.log("❌ No environment specified"); console.log(`👉 Run 'pnpm moonwall --help' for more information`);