1
1
import { WASQLiteOpenFactory , WASQLiteVFS } from '@powersync/web' ;
2
2
import Logger from 'js-logger' ;
3
- import { v4 as uuid } from 'uuid' ;
4
3
import { afterEach , beforeAll , describe , expect , it , vi } from 'vitest' ;
5
4
import { TestConnector } from './utils/MockStreamOpenFactory' ;
6
5
import { ConnectedDatabaseUtils , generateConnectedDatabase } from './utils/generateConnectedDatabase' ;
@@ -23,13 +22,13 @@ describe(
23
22
const funcWithWebWorker = ( ) =>
24
23
generateConnectedDatabase ( {
25
24
powerSyncOptions : {
26
- dbFilename : `test-stream-connection-worker- ${ uuid ( ) } .db`
25
+ dbFilename : `test-stream-connection-worker.db`
27
26
}
28
27
} ) ;
29
28
const funcWithoutWebWorker = ( ) =>
30
29
generateConnectedDatabase ( {
31
30
powerSyncOptions : {
32
- dbFilename : `test-stream-connection-no-worker- ${ uuid ( ) } .db` ,
31
+ dbFilename : `test-stream-connection-no-worker.db` ,
33
32
flags : {
34
33
useWebWorker : false
35
34
}
@@ -43,7 +42,7 @@ describe(
43
42
generateConnectedDatabase ( {
44
43
powerSyncOptions : {
45
44
database : new WASQLiteOpenFactory ( {
46
- dbFilename : `test-stream-connection-opfs- ${ uuid ( ) } .db` ,
45
+ dbFilename : `test-stream-connection-opfs.db` ,
47
46
vfs : WASQLiteVFS . OPFSCoopSyncVFS
48
47
} )
49
48
}
@@ -120,7 +119,7 @@ describe(
120
119
const throwCounter = 2 ;
121
120
uploadSpy . mockImplementation ( async ( db ) => {
122
121
if ( uploadCounter ++ < throwCounter ) {
123
- throw new Error ( ' No uploads yet' ) ;
122
+ throw new Error ( ` ${ new Date ( ) } No uploads yet` ) ;
124
123
}
125
124
// Now actually do the upload
126
125
const tx = await db . getNextCrudTransaction ( ) ;
0 commit comments