summaryrefslogtreecommitdiff
path: root/tests/node_compat/test/fixtures/child-process-spawn-node.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/node_compat/test/fixtures/child-process-spawn-node.js')
-rw-r--r--tests/node_compat/test/fixtures/child-process-spawn-node.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/node_compat/test/fixtures/child-process-spawn-node.js b/tests/node_compat/test/fixtures/child-process-spawn-node.js
new file mode 100644
index 000000000..da2b557c9
--- /dev/null
+++ b/tests/node_compat/test/fixtures/child-process-spawn-node.js
@@ -0,0 +1,14 @@
+const assert = require("assert");
+// TODO(kt3k): Uncomment this when util.debuglog is added
+// const debug = require('util').debuglog('test');
+const debug = console.log;
+
+function onmessage(m) {
+ debug("CHILD got message:", m);
+ assert.ok(m.hello);
+ process.removeListener("message", onmessage);
+}
+
+process.on("message", onmessage);
+// TODO(kt3k): Uncomment the below when the ipc features are ready
+// process.send({ foo: 'bar' });