summaryrefslogtreecommitdiff
path: root/tests/node_compat/test/fixtures
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-09-12 12:24:58 -0700
committerGitHub <noreply@github.com>2024-09-12 19:24:58 +0000
commit18b89d948dcb849c4dc577478794c3d5fb23b597 (patch)
tree9945567e4b53dc50d2a61a3149b51edf97c05839 /tests/node_compat/test/fixtures
parent3f15e300625723df10c564c4e29ec276288a931b (diff)
fix(ext/node): Implement detached option in `child_process` (#25218)
Fixes https://github.com/denoland/deno/issues/25193.
Diffstat (limited to 'tests/node_compat/test/fixtures')
-rw-r--r--tests/node_compat/test/fixtures/child-process-persistent.js8
-rw-r--r--tests/node_compat/test/fixtures/parent-process-nonpersistent.js21
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/node_compat/test/fixtures/child-process-persistent.js b/tests/node_compat/test/fixtures/child-process-persistent.js
new file mode 100644
index 000000000..520c4bebc
--- /dev/null
+++ b/tests/node_compat/test/fixtures/child-process-persistent.js
@@ -0,0 +1,8 @@
+// deno-fmt-ignore-file
+// deno-lint-ignore-file
+
+// Copyright Joyent and Node contributors. All rights reserved. MIT license.
+// Taken from Node 18.12.1
+// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually.
+
+setInterval(function() {}, 9999);
diff --git a/tests/node_compat/test/fixtures/parent-process-nonpersistent.js b/tests/node_compat/test/fixtures/parent-process-nonpersistent.js
new file mode 100644
index 000000000..537478aac
--- /dev/null
+++ b/tests/node_compat/test/fixtures/parent-process-nonpersistent.js
@@ -0,0 +1,21 @@
+// deno-fmt-ignore-file
+// deno-lint-ignore-file
+
+// Copyright Joyent and Node contributors. All rights reserved. MIT license.
+// Taken from Node 18.12.1
+// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually.
+
+// Modified to add `runner.ts` to inject `require` into subprocess
+
+const spawn = require('child_process').spawn,
+ path = require('path'),
+ childPath = path.join(__dirname, 'child-process-persistent.js');
+
+var child = spawn(process.execPath, [ childPath ], {
+ detached: true,
+ stdio: 'ignore'
+});
+
+console.log(child.pid);
+
+child.unref();