Describe the bug
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
browser: {
commands: {
readConfig(encoding: undefined | string, filepath: string) {
// ...
}
},
}
},
});
import { commands } from "vitest/browser";
// On server side: { encoding: "utf8", filepath: "file.ts" } ✅
commands.readConfig("utf8", "file.ts");
// On server side: { encoding: "file.ts", filepath: undefined } ❌
commands.readConfig(undefined, "file.ts");
// Work-around for now:
const encodig: string | undefined = ...
commands.readConfig(encoding ?? null, "file.ts");
Reproduction
#10865
System Info
Vitest CI, Playwright provider, Vitest 4.1 + 5
Used Package Manager
pnpm
Validations
Describe the bug
Reproduction
#10865
System Info
Used Package Manager
pnpm
Validations