diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-05-17 09:44:38 +0200 |
---|---|---|
committer | Luca Casonato <lucacasonato@yahoo.com> | 2021-05-17 09:45:54 +0200 |
commit | 5151afa123a9635d2f4de9555f8843460b284a11 (patch) | |
tree | 7c4686c3f5562dc27d8b863897225236aeb97b14 /cli/tests/workers/test.ts | |
parent | 910935c07125e4710830be0df32a16c3ef278ba6 (diff) |
fix: static import permissions in dynamic imports
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/workers/test.ts')
-rw-r--r-- | cli/tests/workers/test.ts | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/cli/tests/workers/test.ts b/cli/tests/workers/test.ts index 41988d204..954737b3a 100644 --- a/cli/tests/workers/test.ts +++ b/cli/tests/workers/test.ts @@ -8,6 +8,7 @@ import { assertThrows, } from "../../../test_util/std/testing/asserts.ts"; import { deferred } from "../../../test_util/std/async/deferred.ts"; +import { fromFileUrl } from "../../../test_util/std/path/mod.ts"; Deno.test({ name: "worker terminate", @@ -476,8 +477,16 @@ Deno.test("Worker limit children permissions granularly", async function () { //Routes are relative to the spawned worker location const routes = [ - { permission: false, route: "read_check_granular_worker.js" }, - { permission: true, route: "read_check_worker.js" }, + { + permission: false, + path: fromFileUrl( + new URL("read_check_granular_worker.js", import.meta.url), + ), + }, + { + permission: true, + path: fromFileUrl(new URL("read_check_worker.js", import.meta.url)), + }, ]; let checked = 0; @@ -490,10 +499,10 @@ Deno.test("Worker limit children permissions granularly", async function () { } }; - routes.forEach(({ route }, index) => + routes.forEach(({ path }, index) => worker.postMessage({ index, - route, + path, }) ); @@ -553,12 +562,14 @@ Deno.test("Nested worker limit children permissions granularly", async function { childHasPermission: false, parentHasPermission: true, - route: "read_check_granular_worker.js", + path: fromFileUrl( + new URL("read_check_granular_worker.js", import.meta.url), + ), }, { childHasPermission: false, parentHasPermission: false, - route: "read_check_worker.js", + path: fromFileUrl(new URL("read_check_worker.js", import.meta.url)), }, ]; @@ -579,10 +590,10 @@ Deno.test("Nested worker limit children permissions granularly", async function }; // Index needed cause requests will be handled asynchronously - routes.forEach(({ route }, index) => + routes.forEach(({ path }, index) => worker.postMessage({ index, - route, + path, }) ); |