mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
fix(test): url import not found
This commit is contained in:
parent
f6dc912d2a
commit
4dafa56671
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user