-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
I'm trying to make some integraiton tests with Vitest. Some typical scenarios:
- Call backend API affecting some tables in Sync Rules -> expect changes downloaded to the client
- Write some data to client tables -> expect changes uploaded to the backend (-> expect changes downloaded to the client?)
Consider a test with Vitest and PowerSync Node SDK:
test('User signs up', async ({apiClient, kylesyDb, powersyncDb}) => {
await apiClient.signUp({email: '...'});
// HOW TO WAIT FOR A SYNC?
// I could only come up with something like
// await powersyncDb.disconnectAndClear();
// await powersyncDb.connect(connector);
// But it's not an honest test
expect(await db.selectFrom('user').selectAll().executeTakeFirst()).toBeDefined()
});
So, how one await
s for client Sqlite to be in full sync with backend DB?
Metadata
Metadata
Assignees
Labels
No labels