fix: release mappings from edited in-place project files
This commit is contained in:
@@ -314,6 +314,22 @@ describe("Velum-Projektstände", () => {
|
||||
await expect(fs.access(join(source, "Bericht.txt"))).rejects.toMatchObject({ code: "ENOENT" });
|
||||
});
|
||||
|
||||
it("ersetzt keine inzwischen erneut bearbeitete Projektdatei", async () => {
|
||||
const root = await fs.mkdtemp(join(tmpdir(), "velum-in-place-guard-"));
|
||||
roots.push(root);
|
||||
const source = join(root, "Quelle");
|
||||
const support = join(root, "Raycast");
|
||||
await fs.mkdir(source);
|
||||
await fs.writeFile(join(source, "Notiz.md"), "neuer Stand");
|
||||
const created = await project.createRun(source, support);
|
||||
await fs.writeFile(join(created.directory, "files", "Notiz.md"), "korrigierte Ausgabe");
|
||||
await expect(project.replaceProjectFilesInPlace(source, created.directory,
|
||||
[{ source: "Notiz.md", output: "Notiz.md", kind: "text" }],
|
||||
new Map([["Notiz.md", project.digest(Buffer.from("alter Stand"))]])))
|
||||
.rejects.toThrow("vor dem Ersetzen erneut geändert");
|
||||
expect(await fs.readFile(join(source, "Notiz.md"), "utf8")).toBe("neuer Stand");
|
||||
});
|
||||
|
||||
it("verhindert Namenskollisionen vor dem Ersetzen", async () => {
|
||||
const root = await fs.mkdtemp(join(tmpdir(), "velum-in-place-collision-test-"));
|
||||
roots.push(root);
|
||||
|
||||
Reference in New Issue
Block a user