fix(dev-server): normalize hot reload module paths
This commit is contained in:
@@ -83,7 +83,7 @@ test("invalidateModule loads changed server modules without restarting the proce
|
||||
}
|
||||
});
|
||||
|
||||
test("invalidateModule recompiles changed WRN files in-process", async () => {
|
||||
test("invalidateModule recompiles changed WRN files with watcher-normalized separators", async () => {
|
||||
const root = mkdtempSync(join(tmpdir(), "wrnexus-hmr-"));
|
||||
const file = join(root, "page.wrn");
|
||||
setCompileCacheDir(join(root, ".wrnexus"));
|
||||
@@ -94,7 +94,7 @@ test("invalidateModule recompiles changed WRN files in-process", async () => {
|
||||
expect(String(first({}))).toContain("First");
|
||||
|
||||
writeFileSync(file, "page Home { view { <h1>Second</h1> } }\n");
|
||||
invalidateModule(file);
|
||||
invalidateModule(file.replace(/\\/g, "/"));
|
||||
const second = (await loadModule(file)).default as (ctx: unknown) => unknown;
|
||||
expect(String(second({}))).toContain("Second");
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user