1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix: add test ensuring als works across dynamic import (#25593)

The fix is in https://github.com/denoland/deno_core/pull/888

Fixes: https://github.com/denoland/deno/issues/25275

Signed-off-by: snek <snek@deno.com>
This commit is contained in:
snek 2024-09-11 22:42:26 -07:00 committed by GitHub
parent 11b5f2d3ea
commit c9065103b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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");
});
});