summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-10-08 20:43:26 +1100
committerGitHub <noreply@github.com>2020-10-08 11:43:26 +0200
commit9d71b0ef5b6aa7cfa69be7041c3e8ba7c849e89d (patch)
tree09e384fe74acd0e3e23aa00e2a6269cacc58661a /cli/tests
parent986ad08bce7781e17f98d17d223033a2eb0785af (diff)
fix: update worker types to better align to lib.dom.d.ts (#7843)
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/subdir/worker_types.ts4
-rw-r--r--cli/tests/unit/unit_tests.ts1
-rw-r--r--cli/tests/unit/worker_types.ts14
3 files changed, 19 insertions, 0 deletions
diff --git a/cli/tests/subdir/worker_types.ts b/cli/tests/subdir/worker_types.ts
new file mode 100644
index 000000000..7a651e35a
--- /dev/null
+++ b/cli/tests/subdir/worker_types.ts
@@ -0,0 +1,4 @@
+// eslint-disable-next-line require-await
+self.onmessage = async (_msg: MessageEvent) => {
+ self.postMessage("hello");
+};
diff --git a/cli/tests/unit/unit_tests.ts b/cli/tests/unit/unit_tests.ts
index e97c485a8..f545e55fa 100644
--- a/cli/tests/unit/unit_tests.ts
+++ b/cli/tests/unit/unit_tests.ts
@@ -74,6 +74,7 @@ import "./umask_test.ts";
import "./url_test.ts";
import "./url_search_params_test.ts";
import "./utime_test.ts";
+import "./worker_types.ts";
import "./write_file_test.ts";
import "./write_text_file_test.ts";
import "./performance_test.ts";
diff --git a/cli/tests/unit/worker_types.ts b/cli/tests/unit/worker_types.ts
new file mode 100644
index 000000000..e8bc7eb78
--- /dev/null
+++ b/cli/tests/unit/worker_types.ts
@@ -0,0 +1,14 @@
+// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+import { assert, unitTest } from "./test_util.ts";
+
+unitTest(
+ { perms: { read: true } },
+ function utimeSyncFileSuccess() {
+ const w = new Worker(
+ new URL("../subdir/worker_types.ts", import.meta.url).href,
+ { type: "module" },
+ );
+ assert(w);
+ w.terminate();
+ },
+);