summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/testdata/process_really_exit.ts
diff options
context:
space:
mode:
authorMarvin Hagemeister <hello@marvinh.dev>2023-05-31 12:20:38 +0200
committerGitHub <noreply@github.com>2023-05-31 12:20:38 +0200
commitd0efd040c79021958a1e83caa56572c0401ca1f2 (patch)
tree5e2dffb0d680c6918a691c0ba8c553bd99e098db /cli/tests/unit_node/testdata/process_really_exit.ts
parent489d2e81c3e53ed689f51dc9d76c007d487aa101 (diff)
fix(node): add missing process.reallyExit method (#19326)
This PR adds the missing `process.reallyExit()` method to node's `process` object. Was [pinged on twitter](https://twitter.com/biwanczuk/status/1663326659787862017) regarding running the `fastify` test suite in node. They use `node-tap` which has been around arguably the longest of the test frameworks and relies on a couple of old APIs. They have `signal-exit` as a dependency which in turn [makes use of `process.reallyExit()`](https://github.com/tapjs/signal-exit/blob/8fa7fc9a9c63f559af43d292b7eb727901775507/src/index.ts#L19). That function cannot be found anywhere in their documentation, but exists at runtime. See https://github.com/nodejs/node/blob/6a6b3c54022104cc110ab09044a2a0cecb8988e7/lib/internal/bootstrap/node.js#L172 This doesn't yet make `node-tap` work, but gets us one step closer.
Diffstat (limited to 'cli/tests/unit_node/testdata/process_really_exit.ts')
-rw-r--r--cli/tests/unit_node/testdata/process_really_exit.ts10
1 files changed, 10 insertions, 0 deletions
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();