Skip to content

Commit bd14606

Browse files
authored
ensure we exit (#2198)
1 parent fb0c81b commit bd14606

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

private/bdd_runner/src/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
SyntaxKind,
1010
VariableDeclarationKind,
1111
} from "ts-morph";
12-
import Cli from "@cucumber/cucumber/lib/cli/index";
12+
import Cli, { ICliRunResult } from "@cucumber/cucumber/lib/cli/index";
1313

1414
import path from "path";
1515
import fs from "fs";
@@ -223,7 +223,7 @@ function generateApiInfo(servicesDir: string, useBuiltPackages: boolean) {
223223
sourceFile.saveSync();
224224
}
225225

226-
function main() {
226+
async function main(): Promise<ICliRunResult>{
227227
let cwd = process.cwd();
228228
const program = new Command();
229229
program
@@ -321,7 +321,11 @@ function main() {
321321
generateApiInfo(worldParameters["servicesDir"], options.useBuiltPackages);
322322

323323
// Run Cucumber
324-
cli.run();
324+
return cli.run();
325325
}
326326

327-
main();
327+
// Run the main function and exit with the result
328+
(async () => {
329+
const result = await main();
330+
process.exit(result.success ? 0 : 1);
331+
})();

run-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# }
66
# trap finish EXIT
77

8+
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack enable
89
yarn install
910

1011
if [ "$USE_BUILT_PACKAGES" == "false" ]; then

0 commit comments

Comments
 (0)