From 993a1dd41ae5f96bdb24b09757e24c2ac24126d0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 28 Nov 2021 00:45:38 +0100 Subject: feat(runtime): add op_set_exit_code (#12911) Set the exit code to use if none is provided to Deno.exit(), or when Deno exits naturally. Needed for process.exitCode Node compat. Paves the way for #12888. --- cli/tests/integration/run_tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index d6a5a4c25..47041e499 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -859,6 +859,24 @@ itest!(exit_error42 { output: "exit_error42.ts.out", }); +itest!(set_exit_code_0 { + args: "run --no-check --unstable set_exit_code_0.ts", + output: "empty.out", + exit_code: 0, +}); + +itest!(set_exit_code_1 { + args: "run --no-check --unstable set_exit_code_1.ts", + output: "empty.out", + exit_code: 42, +}); + +itest!(set_exit_code_2 { + args: "run --no-check --unstable set_exit_code_2.ts", + output: "empty.out", + exit_code: 42, +}); + itest!(heapstats { args: "run --quiet --unstable --v8-flags=--expose-gc heapstats.js", output: "heapstats.js.out", -- cgit v1.2.3