diff options
author | Marvin Hagemeister <hello@marvinh.dev> | 2023-05-11 12:32:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 12:32:19 +0200 |
commit | f1d0f745d362adb2e19a54693ed10d9020e987fa (patch) | |
tree | cf4086b95123952cd28883a03c2e1df82a7c79bb /cli/tests | |
parent | 28aa489de9cd4f995ec2fc02e2c9d224e89f4c01 (diff) |
fix(node): expose channels in worker_threads (#19086)
This PR ensures that node's `worker_threads` module exports
`MessageChannel`, `MessagePort` and the `BroadcastChannel` API. Fixing
these won't make `esbuild` work, but brings us one step closer 🎉
Fixes #19028 .
Diffstat (limited to 'cli/tests')
3 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/node_compat/config.jsonc b/cli/tests/node_compat/config.jsonc index 87530d4f5..8fbc3e921 100644 --- a/cli/tests/node_compat/config.jsonc +++ b/cli/tests/node_compat/config.jsonc @@ -655,6 +655,8 @@ "test-whatwg-url-override-hostname.js", "test-whatwg-url-properties.js", "test-whatwg-url-toascii.js", + "test-worker-threads-broadcast-channel.js", + "test-worker-threads-message-channel.js", "test-zlib-close-after-error.js", "test-zlib-close-after-write.js", "test-zlib-convenience-methods.js", diff --git a/cli/tests/node_compat/test/parallel/test-worker-threads-broadcast-channel.js b/cli/tests/node_compat/test/parallel/test-worker-threads-broadcast-channel.js new file mode 100644 index 000000000..a8fd3ff0e --- /dev/null +++ b/cli/tests/node_compat/test/parallel/test-worker-threads-broadcast-channel.js @@ -0,0 +1,9 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +"use strict"; + +const assert = require("assert/strict"); +const worker_threads = require("worker_threads"); + +assert.equal(BroadcastChannel, worker_threads.BroadcastChannel); diff --git a/cli/tests/node_compat/test/parallel/test-worker-threads-message-channel.js b/cli/tests/node_compat/test/parallel/test-worker-threads-message-channel.js new file mode 100644 index 000000000..b831ed3fe --- /dev/null +++ b/cli/tests/node_compat/test/parallel/test-worker-threads-message-channel.js @@ -0,0 +1,10 @@ +// deno-fmt-ignore-file +// deno-lint-ignore-file + +"use strict"; + +const assert = require("assert/strict"); +const worker_threads = require("worker_threads"); + +assert.equal(MessageChannel, worker_threads.MessageChannel); +assert.equal(MessagePort, worker_threads.MessagePort); |