test: disable Vitest fs cache on Windows

This commit is contained in:
Tak Hoffman
2026-03-24 21:46:29 -05:00
parent 3c46e0307a
commit 64432f8e46
2 changed files with 50 additions and 1 deletions

View File

@@ -22,6 +22,43 @@ describe("loadVitestExperimentalConfig", () => {
});
});
it("disables the filesystem module cache by default on Windows", () => {
const originalRunnerOs = process.env.RUNNER_OS;
process.env.RUNNER_OS = "Windows";
try {
expect(loadVitestExperimentalConfig({ RUNNER_OS: "Windows" })).toEqual({});
} finally {
if (originalRunnerOs === undefined) {
delete process.env.RUNNER_OS;
} else {
process.env.RUNNER_OS = originalRunnerOs;
}
}
});
it("still allows enabling the filesystem module cache explicitly on Windows", () => {
const originalRunnerOs = process.env.RUNNER_OS;
process.env.RUNNER_OS = "Windows";
try {
expect(
loadVitestExperimentalConfig({
RUNNER_OS: "Windows",
OPENCLAW_VITEST_FS_MODULE_CACHE: "1",
}),
).toEqual({
experimental: {
fsModuleCache: true,
},
});
} finally {
if (originalRunnerOs === undefined) {
delete process.env.RUNNER_OS;
} else {
process.env.RUNNER_OS = originalRunnerOs;
}
}
});
it("allows disabling the filesystem module cache explicitly", () => {
expect(
loadVitestExperimentalConfig({