Tests: document fresh import helper

This commit is contained in:
Vincent Koc
2026-03-12 01:26:11 -04:00
parent cced4823b1
commit 05ac9e53cf

View File

@@ -2,5 +2,7 @@ export async function importFreshModule<TModule>(
from: string,
specifier: string,
): Promise<TModule> {
// Vitest keys module instances by the full URL string, including the query
// suffix. These tests rely on that behavior to emulate code-split chunks.
return (await import(/* @vite-ignore */ new URL(specifier, from).href)) as TModule;
}