diff options
Diffstat (limited to 'tests/unit_node/async_hooks_test.ts')
-rw-r--r-- | tests/unit_node/async_hooks_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit_node/async_hooks_test.ts b/tests/unit_node/async_hooks_test.ts index 91130972c..edad57bf7 100644 --- a/tests/unit_node/async_hooks_test.ts +++ b/tests/unit_node/async_hooks_test.ts @@ -160,3 +160,15 @@ Deno.test(async function worksWithAsyncAPIs() { test(); }); }); + +Deno.test(async function worksWithDynamicImports() { + const store = new AsyncLocalStorage(); + // @ts-expect-error implicit any + globalThis.alsDynamicImport = () => store.getStore(); + const dataUrl = + `data:application/javascript,export const data = alsDynamicImport()`; + await store.run("data", async () => { + const { data } = await import(dataUrl); + assertEquals(data, "data"); + }); +}); |