Format & lint

This commit is contained in:
Andras Schmelczer 2026-04-25 17:55:46 +01:00
commit 7f62273e72

View file

@ -1,3 +1,4 @@
import type { AssertableState } from "../utils/assertable-state";
import type { TestDefinition } from "../test-definition";
export const movePreservesRemoteUpdateTest: TestDefinition = {
@ -6,7 +7,12 @@ export const movePreservesRemoteUpdateTest: TestDefinition = {
"After both reconnect, the renamed file should contain client 1's edit.",
clients: 2,
steps: [
{ type: "create", client: 0, path: "doc.md", content: "line 1\nline 2" },
{
type: "create",
client: 0,
path: "doc.md",
content: "line 1\nline 2"
},
{ type: "enable-sync", client: 0 },
{ type: "enable-sync", client: 1 },
{ type: "sync" },
@ -16,7 +22,12 @@ export const movePreservesRemoteUpdateTest: TestDefinition = {
{ type: "disable-sync", client: 1 },
{ type: "rename", client: 0, oldPath: "doc.md", newPath: "renamed.md" },
{ type: "update", client: 1, path: "doc.md", content: "line 1\nclient 1 edit\nline 2" },
{
type: "update",
client: 1,
path: "doc.md",
content: "line 1\nclient 1 edit\nline 2"
},
{ type: "enable-sync", client: 0 },
{ type: "enable-sync", client: 1 },
@ -25,13 +36,15 @@ export const movePreservesRemoteUpdateTest: TestDefinition = {
{
type: "assert-consistent",
verify: (s) => {
verify: (s: AssertableState): void => {
s.assertFileCount(1);
const content = Array.from(s.files.values())[0];
const [content] = Array.from(s.files.values());
if (!content.includes("client 1 edit")) {
throw new Error(`Expected merged content to include "client 1 edit", got: "${content}"`);
throw new Error(
`Expected merged content to include "client 1 edit", got: "${content}"`
);
}
}
},
],
}
]
};