Skip to content

Commit bcd8233

Browse files
authored
[Misc] Fix Vite warning when running tests (#851)
* fix vite warning * add subfolders to glob pattern
1 parent cc24287 commit bcd8233

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/vitest.setup.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ vi.mock("i18next", async (importOriginal) => {
3535
const filename = req.params[0];
3636

3737
try {
38-
const json = await import(`../public/locales/en/${req.params[0]}`);
38+
const localeFiles = import.meta.glob("../public/locales/en/**/*.json", { eager: true });
39+
const json = localeFiles[`../public/locales/en/${filename}`] || {};
3940
console.log("Loaded locale", filename);
4041
return HttpResponse.json(json);
4142
} catch (err) {

0 commit comments

Comments
 (0)