feat: remember project exclusions and merge selected people
This commit is contained in:
@@ -20,6 +20,14 @@ describe("Velum-Projektstände", () => {
|
||||
const rules = project.parseProjectRules("PERSON: Max Mustermann\nKundenSuite");
|
||||
await project.saveProjectRules(source, rules, support);
|
||||
expect(await project.loadProjectRules(source, support)).toEqual(rules);
|
||||
await project.saveProjectWhitelist(source, [
|
||||
{ type: "PERSON", original: "Falscher Treffer" },
|
||||
{ type: "PERSON", original: "falscher treffer" },
|
||||
], support);
|
||||
expect(await project.loadProjectWhitelist(source, support)).toEqual([
|
||||
{ type: "PERSON", original: "falscher treffer" },
|
||||
]);
|
||||
expect(await fs.readFile(join(source, "Notiz.txt"), "utf8")).toBe("Max Mustermann");
|
||||
const created = await project.createRun(source, support);
|
||||
created.run.mapping = { PERSON_01: { original: "Max Mustermann", type: "PERSON" } };
|
||||
created.run.files.push({ source: "Notiz.txt", output: "PERSON_01.txt", kind: "text" });
|
||||
@@ -82,4 +90,22 @@ describe("Velum-Projektstände", () => {
|
||||
expect(await fs.readFile(join(source, "Bericht.txt"), "utf8")).toBe("Original");
|
||||
expect(await fs.readFile(join(source, "PERSON_01.txt"), "utf8")).toBe("Andere Datei");
|
||||
});
|
||||
|
||||
it("erkennt unveränderte Ausgaben für einen erneuten Lauf desselben Ordners", async () => {
|
||||
const root = await fs.mkdtemp(join(tmpdir(), "velum-repeat-test-"));
|
||||
roots.push(root);
|
||||
const source = join(root, "Quelle");
|
||||
const support = join(root, "Raycast");
|
||||
await fs.mkdir(source);
|
||||
const created = await project.createRun(source, support);
|
||||
const filename = "PERSON_01.txt";
|
||||
await fs.writeFile(join(created.directory, "files", filename), "PERSON_01");
|
||||
const current = join(source, filename);
|
||||
await fs.writeFile(current, "PERSON_01");
|
||||
const hash = project.digest(await fs.readFile(current));
|
||||
expect(await project.matchesPreviousOutput(created.directory, filename, hash)).toBe(true);
|
||||
await fs.writeFile(current, "PERSON_01 und neuer Text");
|
||||
expect(await project.matchesPreviousOutput(created.directory, filename,
|
||||
project.digest(await fs.readFile(current)))).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user