summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit_node')
-rw-r--r--cli/tests/unit_node/process_test.ts19
-rw-r--r--cli/tests/unit_node/testdata/process_really_exit.ts10
2 files changed, 29 insertions, 0 deletions
diff --git a/cli/tests/unit_node/process_test.ts b/cli/tests/unit_node/process_test.ts
index 686a3dbbc..49b753db3 100644
--- a/cli/tests/unit_node/process_test.ts
+++ b/cli/tests/unit_node/process_test.ts
@@ -727,3 +727,22 @@ Deno.test({
assertEquals(stripColor(decoder.decode(stdout).trim()), "exit");
},
});
+
+Deno.test({
+ name: "process.reallyExit",
+ async fn() {
+ const command = new Deno.Command(Deno.execPath(), {
+ args: [
+ "run",
+ "--quiet",
+ "--unstable",
+ "./testdata/process_really_exit.ts",
+ ],
+ cwd: testDir,
+ });
+ const { stdout } = await command.output();
+
+ const decoder = new TextDecoder();
+ assertEquals(stripColor(decoder.decode(stdout).trim()), "really exited");
+ },
+});
diff --git a/cli/tests/unit_node/testdata/process_really_exit.ts b/cli/tests/unit_node/testdata/process_really_exit.ts
new file mode 100644
index 000000000..16f30b33d
--- /dev/null
+++ b/cli/tests/unit_node/testdata/process_really_exit.ts
@@ -0,0 +1,10 @@
+import process from "node:process";
+
+//deno-lint-ignore no-undef
+// @ts-ignore - Node typings don't even have this because it's
+// been deprecated for 4 years. But it's used in `signal-exit`,
+// which in turn is used in `node-tap`.
+process.reallyExit = function () {
+ console.info("really exited");
+};
+process.exit();