summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/compile/workers/not_in_module_map.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/compile/workers/not_in_module_map.ts')
-rw-r--r--cli/tests/testdata/compile/workers/not_in_module_map.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/testdata/compile/workers/not_in_module_map.ts b/cli/tests/testdata/compile/workers/not_in_module_map.ts
new file mode 100644
index 000000000..b43f8cb1f
--- /dev/null
+++ b/cli/tests/testdata/compile/workers/not_in_module_map.ts
@@ -0,0 +1,11 @@
+// This time ./worker.ts is not in the module map, so the worker
+// initialization will fail unless worker.js is passed as a side module.
+
+const worker = new Worker(
+ new URL("./worker.ts", import.meta.url),
+ { type: "module" },
+);
+
+setTimeout(() => {
+ worker.postMessage(42);
+}, 500);