fix(test): url import not found

This commit is contained in:
Elian Doran 2025-04-28 11:03:38 +03:00
parent f6dc912d2a
commit 4dafa56671
No known key found for this signature in database

View File

@ -1,9 +1,6 @@
import { LOCALES } from "@triliumnext/commons";
import { readFileSync } from "fs";
import { join, dirname } from "path";
import { fileURLToPath } from "url";
const scriptDir = dirname(fileURLToPath(import.meta.url));
import { join } from "path";
describe("i18n", () => {
it("translations are valid JSON", () => {
@ -12,7 +9,7 @@ describe("i18n", () => {
continue;
}
const translationPath = join(scriptDir, "..", "translations", locale.id, "translation.json");
const translationPath = join(__dirname, "..", "translations", locale.id, "translation.json");
const translationFile = readFileSync(translationPath, { encoding: "utf-8" });
expect(() => JSON.parse(translationFile), `JSON error while parsing locale '${locale.id}' at "${translationPath}"`)
.not.toThrow();