mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-16 11:21:37 +08:00
19 lines
686 B
TypeScript
19 lines
686 B
TypeScript
import { LOCALES } from "@triliumnext/commons";
|
|
import { readFileSync } from "fs";
|
|
import { join } from "path";
|
|
|
|
describe("i18n", () => {
|
|
it("translations are valid JSON", () => {
|
|
for (const locale of LOCALES) {
|
|
if (locale.contentOnly) {
|
|
continue;
|
|
}
|
|
|
|
const translationPath = join(__dirname, "..", "assets", "translations", locale.id, "server.json");
|
|
const translationFile = readFileSync(translationPath, { encoding: "utf-8" });
|
|
expect(() => JSON.parse(translationFile), `JSON error while parsing locale '${locale.id}' at "${translationPath}"`)
|
|
.not.toThrow();
|
|
}
|
|
});
|
|
});
|