Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: add test ensuring als works across dynamic import
Fixes: #25275

Signed-off-by: snek <[email protected]>
  • Loading branch information
devsnek authored Sep 12, 2024
commit 20c1728fcb3b6ed27f7a68ed3e9fc8bf8e7ce57a
11 changes: 11 additions & 0 deletions tests/unit_node/async_hooks_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,14 @@ Deno.test(async function worksWithAsyncAPIs() {
test();
});
});

Deno.test(async function worksWithDynamicImports() {
const store = new AsyncLocalStorage();
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