mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
22 lines
672 B
TypeScript
22 lines
672 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { createRequire } from "node:module";
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const { isSourceFile } = require("./crowdin-pretranslate.cjs") as {
|
|
isSourceFile: (file: { path?: string }) => boolean;
|
|
};
|
|
|
|
describe("isSourceFile", () => {
|
|
it("matches the core source file", () => {
|
|
expect(isSourceFile({ path: "/en.json" })).toBe(true);
|
|
});
|
|
|
|
it("skips anything else", () => {
|
|
expect(isSourceFile({ path: "/src/ui/locales/en.json" })).toBe(false);
|
|
expect(isSourceFile({ path: "/plugins/acme-ssl/locales/en.json" })).toBe(
|
|
false,
|
|
);
|
|
expect(isSourceFile({})).toBe(false);
|
|
});
|
|
});
|