mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-19 09:02:27 +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 { LOCALES } from "@triliumnext/commons";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import { join, dirname } from "path";
|
import { join } from "path";
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
|
|
||||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
describe("i18n", () => {
|
describe("i18n", () => {
|
||||||
it("translations are valid JSON", () => {
|
it("translations are valid JSON", () => {
|
||||||
@ -12,7 +9,7 @@ describe("i18n", () => {
|
|||||||
continue;
|
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" });
|
const translationFile = readFileSync(translationPath, { encoding: "utf-8" });
|
||||||
expect(() => JSON.parse(translationFile), `JSON error while parsing locale '${locale.id}' at "${translationPath}"`)
|
expect(() => JSON.parse(translationFile), `JSON error while parsing locale '${locale.id}' at "${translationPath}"`)
|
||||||
.not.toThrow();
|
.not.toThrow();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user