11import { WASQLiteOpenFactory , WASQLiteVFS } from '@powersync/web' ;
22import Logger from 'js-logger' ;
3+ import { v4 as uuid } from 'uuid' ;
34import { afterEach , beforeAll , describe , expect , it , vi } from 'vitest' ;
45import { TestConnector } from './utils/MockStreamOpenFactory' ;
56import { ConnectedDatabaseUtils , generateConnectedDatabase } from './utils/generateConnectedDatabase' ;
@@ -19,11 +20,16 @@ describe(
1920 name : string ,
2021 test : ( createConnectedDatabase : ( ) => ReturnType < typeof generateConnectedDatabase > ) => Promise < void >
2122 ) => {
22- const funcWithWebWorker = generateConnectedDatabase ;
23+ const funcWithWebWorker = ( ) =>
24+ generateConnectedDatabase ( {
25+ powerSyncOptions : {
26+ dbFilename : `test-stream-connection-worker-${ uuid ( ) } .db`
27+ }
28+ } ) ;
2329 const funcWithoutWebWorker = ( ) =>
2430 generateConnectedDatabase ( {
2531 powerSyncOptions : {
26- dbFilename : ' test-stream-connection-no-worker.db' ,
32+ dbFilename : ` test-stream-connection-no-worker- ${ uuid ( ) } .db` ,
2733 flags : {
2834 useWebWorker : false
2935 }
@@ -37,7 +43,7 @@ describe(
3743 generateConnectedDatabase ( {
3844 powerSyncOptions : {
3945 database : new WASQLiteOpenFactory ( {
40- dbFilename : ' test-stream-connection-opfs.db' ,
46+ dbFilename : ` test-stream-connection-opfs- ${ uuid ( ) } .db` ,
4147 vfs : WASQLiteVFS . OPFSCoopSyncVFS
4248 } )
4349 }
0 commit comments