File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,13 @@ void main() {
21
21
await testUtils.cleanDb (path: path);
22
22
});
23
23
24
- generateSourceTableTests (testUtils.findSqliteLibraries (), () => path);
24
+ generateSourceTableTests (testUtils.findSqliteLibraries (),
25
+ (String sqlitePath) async {
26
+ final db =
27
+ SqliteDatabase .withFactory (await testUtils.testFactory (path: path));
28
+ await db.initialize ();
29
+ return db;
30
+ });
25
31
26
32
test ('watch in isolate' , () async {
27
33
final db = await testUtils.setupDatabase (path: path);
Original file line number Diff line number Diff line change @@ -22,13 +22,11 @@ createTables(SqliteDatabase db) async {
22
22
}
23
23
24
24
// Web and native have different requirements for `sqlitePaths`.
25
- void generateSourceTableTests (
26
- List < String > sqlitePaths, String Function () getPath ) {
25
+ void generateSourceTableTests (List < String > sqlitePaths,
26
+ Future < SqliteDatabase > Function (String sqlitePath) generateDB ) {
27
27
for (var sqlite in sqlitePaths) {
28
28
test ('getSourceTables - $sqlite ' , () async {
29
- final db = SqliteDatabase .withFactory (
30
- await testUtils.testFactory (path: getPath (), sqlitePath: sqlite));
31
- await db.initialize ();
29
+ final db = await generateDB (sqlite);
32
30
await createTables (db);
33
31
34
32
var versionRow = await db.get ('SELECT sqlite_version() as version' );
Original file line number Diff line number Diff line change 1
1
@TestOn ('browser' )
2
+ import 'package:sqlite_async/sqlite_async.dart' ;
2
3
import 'package:test/test.dart' ;
3
4
4
5
import '../utils/test_utils_impl.dart' ;
@@ -18,6 +19,11 @@ void main() {
18
19
19
20
/// Can't use testUtils instance here since it requires spawnHybridUri
20
21
/// which is not available when declaring tests
21
- generateSourceTableTests (['sqlite3.wasm' ], () => path);
22
+ generateSourceTableTests (['sqlite3.wasm' ], (String sqlitePath) async {
23
+ final db =
24
+ SqliteDatabase .withFactory (await testUtils.testFactory (path: path));
25
+ await db.initialize ();
26
+ return db;
27
+ });
22
28
});
23
29
}
You can’t perform that action at this time.
0 commit comments