summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit_node/testdata/worker_module/index.js3
-rw-r--r--cli/tests/unit_node/testdata/worker_module/other_file.js3
-rw-r--r--cli/tests/unit_node/testdata/worker_module/package.json4
-rw-r--r--cli/tests/unit_node/worker_threads_test.ts10
4 files changed, 20 insertions, 0 deletions
diff --git a/cli/tests/unit_node/testdata/worker_module/index.js b/cli/tests/unit_node/testdata/worker_module/index.js
new file mode 100644
index 000000000..a3e976b65
--- /dev/null
+++ b/cli/tests/unit_node/testdata/worker_module/index.js
@@ -0,0 +1,3 @@
+import { myFunction } from "./other_file.js";
+
+myFunction().then(() => {});
diff --git a/cli/tests/unit_node/testdata/worker_module/other_file.js b/cli/tests/unit_node/testdata/worker_module/other_file.js
new file mode 100644
index 000000000..41789dfe8
--- /dev/null
+++ b/cli/tests/unit_node/testdata/worker_module/other_file.js
@@ -0,0 +1,3 @@
+export async function myFunction() {
+ await new Promise((resolve) => setTimeout(resolve, 100));
+}
diff --git a/cli/tests/unit_node/testdata/worker_module/package.json b/cli/tests/unit_node/testdata/worker_module/package.json
new file mode 100644
index 000000000..486d2f82b
--- /dev/null
+++ b/cli/tests/unit_node/testdata/worker_module/package.json
@@ -0,0 +1,4 @@
+{
+ "name": "foo",
+ "type": "module"
+}
diff --git a/cli/tests/unit_node/worker_threads_test.ts b/cli/tests/unit_node/worker_threads_test.ts
index f53b1e692..c46df057e 100644
--- a/cli/tests/unit_node/worker_threads_test.ts
+++ b/cli/tests/unit_node/worker_threads_test.ts
@@ -134,6 +134,16 @@ Deno.test({
});
Deno.test({
+ name: "[worker_threads] worker thread with type module",
+ fn() {
+ const worker = new workerThreads.Worker(
+ new URL("./testdata/worker_module/index.js", import.meta.url),
+ );
+ worker.terminate();
+ },
+});
+
+Deno.test({
name: "[worker_threads] inheritences",
async fn() {
const worker = new workerThreads.Worker(