chore(test/server): fix some mocks no longer working

This commit is contained in:
Elian Doran 2025-04-28 17:35:52 +03:00
parent 6db6bec847
commit bb278d495e
No known key found for this signature in database

View File

@ -1,11 +1,9 @@
import { beforeAll } from "vitest";
import { getResourceDir } from "../src/services/utils.js";
import i18next from "i18next";
import { join } from "path";
beforeAll(async () => {
// Initialize the translations manually to avoid any side effects.
const resourceDir = getResourceDir();
const Backend = (await import("i18next-fs-backend")).default;
// Initialize translations
@ -14,7 +12,7 @@ beforeAll(async () => {
fallbackLng: "en",
ns: "server",
backend: {
loadPath: join(resourceDir, "assets/translations/{{lng}}/{{ns}}.json")
loadPath: join(__dirname, "../src/assets/translations/{{lng}}/{{ns}}.json")
}
});
});