Skip to content

Commit 4cc26ed

Browse files
add log
1 parent ef2f2fd commit 4cc26ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/web/tests/stream.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ describe(
187187
});
188188

189189
itWithGenerators('Should retry failed uploads when connected', async (createConnectedDatabase) => {
190+
console.log('connecting');
190191
connectionUtilities = await createConnectedDatabase();
192+
console.log('connected');
191193
const { powersync, uploadSpy } = connectionUtilities;
192194

193195
expect(powersync.connected).toBe(true);
@@ -199,18 +201,23 @@ describe(
199201
if (uploadCounter++ < throwCounter) {
200202
throw new Error('No uploads yet');
201203
}
204+
console.log('allowing the upload');
202205
// Now actually do the upload
203206
const tx = await db.getNextCrudTransaction();
204207
await tx?.complete();
205208
});
206209

210+
console.log('creating an item');
207211
// do something which should trigger an upload
208212
await powersync.execute('INSERT INTO users (id, name) VALUES (uuid(), ?)', ['name']);
209213

214+
console.log('done creating an item');
215+
210216
// It should try and upload
211217
await vi.waitFor(
212218
() => {
213219
// to-have-been-called seems to not work after failing a check
220+
console.log('the number of calls is ',uploadSpy.mock.calls.length);
214221
expect(uploadSpy.mock.calls.length).equals(throwCounter + 1);
215222
},
216223
{

0 commit comments

Comments
 (0)