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:
parent
11b5f2d3ea
commit
c9065103b8
1 changed files with 12 additions and 0 deletions
|
@ -160,3 +160,15 @@ Deno.test(async function worksWithAsyncAPIs() {
|
||||||
test();
|
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");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue