Skip to content

Commit

Permalink
[test] Sync timings
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgpearce committed Apr 8, 2024
1 parent a6b463e commit b95ae1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/unit/persisters/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ export const mockSync: Persistable<[Bus, MergeableStore]> = {
getLocation: async (): Promise<[Bus, MergeableStore]> => {
const bus = createLocalBus();
const otherStore = createMergeableStore('s2');
await createSyncPersister(otherStore, bus).startAutoSave();
await createSyncPersister(otherStore, bus, 0.01).startSync();
return [bus, otherStore];
},
getLocationMethod: ['getBus', (location) => location[0]],
getPersister: (store: Store, location) =>
createSyncPersister(store as MergeableStore, location[0]),
createSyncPersister(store as MergeableStore, location[0], 0.01),
get: async (
location: [Bus, MergeableStore],
): Promise<Content | MergeableContent | void> => {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/persisters/persister-mergeable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
import {pause} from '../common/other';

beforeEach(() => {
jest.useFakeTimers({now: START_TIME});
jest.useFakeTimers({now: START_TIME, advanceTimers: true});
});

afterEach(() => {
Expand Down Expand Up @@ -136,7 +136,7 @@ describe.each([
}
});

test('loads', async () => {
test.only('loads', async () => {
await persistable.set(location, [
'Hc2DO@000008DKS9',
[
Expand Down
4 changes: 2 additions & 2 deletions test/unit/persisters/persister-sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ beforeEach(() => {
const bus = createLocalBus();
store1 = createMergeableStore('s1');
store2 = createMergeableStore('s2');
persister1 = createSyncPersister(store1, bus, 0.001);
persister2 = createSyncPersister(store2, bus, 0.001);
persister1 = createSyncPersister(store1, bus, 0.01);
persister2 = createSyncPersister(store2, bus, 0.01);
});

describe('Unidirectional', () => {
Expand Down

0 comments on commit b95ae1d

Please sign in to comment.