From 9d71b0ef5b6aa7cfa69be7041c3e8ba7c849e89d Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 8 Oct 2020 20:43:26 +1100 Subject: fix: update worker types to better align to lib.dom.d.ts (#7843) --- cli/tests/subdir/worker_types.ts | 4 ++++ cli/tests/unit/unit_tests.ts | 1 + cli/tests/unit/worker_types.ts | 14 ++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 cli/tests/subdir/worker_types.ts create mode 100644 cli/tests/unit/worker_types.ts (limited to 'cli/tests') 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(); + }, +); -- cgit v1.2.3