This commit is contained in:
Andras Schmelczer 2026-09-27 11:09:36 +01:00
commit ff1f474324

View file

@ -4,7 +4,7 @@ import * as fs from "node:fs/promises";
import * as path from "node:path";
import { tmpdir } from "node:os";
import { NodeFileSystemOperations } from "../local-client-cli/src/node-filesystem";
import { Database, emptyState } from "../sync-client/src/persistence/database";
import { Database, createEmptyDatabase } from "../sync-client/src/persistence/database";
import { FileOperations } from "../sync-client/src/file-operations/file-operations";
import type { ServerConfig } from "../sync-client/src/services/server-config";
import { hashSnapshot } from "../sync-client/src/snapshot";
@ -97,7 +97,7 @@ test(
"original bytes"
);
}
const initial = emptyState("real");
const initial = createEmptyDatabase("real");
initial.local = { a: "a.md", b: "b.md" };
for (const [id, relative] of Object.entries(initial.local))
initial.documents[id] = {
@ -119,7 +119,7 @@ test(
} as ServerConfig);
const next = structuredClone(initial);
next.local = { a: "b.md", b: "a.md" };
await operations.apply(next);
await operations.applyChanges(next);
assert.equal(
Buffer.from(
(await disk.read("a.md"))!.content