Skip to content

Commit f1b24c2

Browse files
committed
test(db): add markReady calls
1 parent 7f7a81c commit f1b24c2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/db/tests/query/indexes.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe(`Query Index Optimization`, () => {
237237
getKey: (item) => item.id,
238238
startSync: true,
239239
sync: {
240-
sync: ({ begin, write, commit }) => {
240+
sync: ({ begin, write, commit, markReady }) => {
241241
// Provide initial data through sync
242242
begin()
243243
for (const item of testData) {
@@ -247,6 +247,7 @@ describe(`Query Index Optimization`, () => {
247247
})
248248
}
249249
commit()
250+
markReady()
250251

251252
// Listen for mutations and sync them back (only register once)
252253
if (!emitter.all.has(`sync`)) {
@@ -534,7 +535,7 @@ describe(`Query Index Optimization`, () => {
534535
getKey: (item) => item.id,
535536
startSync: true,
536537
sync: {
537-
sync: ({ begin, write, commit }) => {
538+
sync: ({ begin, write, commit, markReady }) => {
538539
begin()
539540
write({
540541
type: `insert`,
@@ -547,6 +548,7 @@ describe(`Query Index Optimization`, () => {
547548
},
548549
})
549550
commit()
551+
markReady()
550552
},
551553
},
552554
})
@@ -622,7 +624,7 @@ describe(`Query Index Optimization`, () => {
622624
getKey: (item) => item.id,
623625
startSync: true,
624626
sync: {
625-
sync: ({ begin, write, commit }) => {
627+
sync: ({ begin, write, commit, markReady }) => {
626628
begin()
627629
write({
628630
type: `insert`,
@@ -645,6 +647,7 @@ describe(`Query Index Optimization`, () => {
645647
},
646648
})
647649
commit()
650+
markReady()
648651
},
649652
},
650653
})

0 commit comments

Comments
 (0)