Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensJourney committed Feb 11, 2025
1 parent 8cc200a commit ff29043
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/web/tests/stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ describe('Streaming', {
const { powersync, uploadSpy } = await createConnectedDatabase();
expect(powersync.connected).toBe(true);

console.log('database connected');

let uploadStartedPromise = new Promise<void>((resolve) => {
uploadSpy.mockImplementation(async (db) => {
resolve();
Expand All @@ -268,13 +270,17 @@ describe('Streaming', {
// do something which should trigger an upload
await powersync.execute('INSERT INTO users (id, name) VALUES (uuid(), ?)', ['name']);

console.log('created item');
await uploadStartedPromise;
console.log('upload started');

expect(powersync.currentStatus.dataFlowStatus.uploading).true;

// Status should update after uploads are completed
await vi.waitFor(
() => {
// to-have-been-called seems to not work after failing a check
console.log('upload status is', powersync.currentStatus.dataFlowStatus.uploading)
expect(powersync.currentStatus.dataFlowStatus.uploading).false;
},
{
Expand Down

0 comments on commit ff29043

Please sign in to comment.