Skip to content

Commit

Permalink
core: fix sync tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Mar 5, 2024
1 parent 35c35fa commit ca9a8d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/core/__e2e__/sync.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ test(
const handler = vitest.fn();
deviceB.eventManager.subscribe(EVENTS.syncProgress, handler);

await deviceB.sync(true);
await deviceB.sync({ type: "full" });

expect(handler).not.toHaveBeenCalled();

Expand Down Expand Up @@ -415,7 +415,7 @@ async function initializeDevice(id, capabilities = []) {

await device.user.resetUser(false);

await device.sync(true, false);
await device.sync({ type: "full" });

console.timeEnd(`Init ${id}`);
return device;
Expand Down Expand Up @@ -448,7 +448,13 @@ function syncAndWait(deviceA, deviceB, force = false) {
(full, force, lastSynced) => {
console.log("sync requested by device A", full, force, lastSynced);
ref2.unsubscribe();
deviceB.sync(full, force, lastSynced).catch(reject);
deviceB
.sync({
type: full ? "full" : "send",
force,
serverLastSynced: lastSynced
})
.catch(reject);
}
);

Expand All @@ -466,6 +472,6 @@ function syncAndWait(deviceA, deviceB, force = false) {
deviceB.syncer.sync.syncing
);

deviceA.sync(true, force).catch(reject);
deviceA.sync({ type: "full", force }).catch(reject);
});
}

0 comments on commit ca9a8d1

Please sign in to comment.