diff --git a/packages_web/sqflite_common_ffi_web_test/.gitignore b/packages_web/sqflite_common_ffi_web_test/.gitignore index 2006521e..8737eac9 100644 --- a/packages_web/sqflite_common_ffi_web_test/.gitignore +++ b/packages_web/sqflite_common_ffi_web_test/.gitignore @@ -9,3 +9,4 @@ build/ /web/sqlite3.wasm /test/sqflite_sw.js /test/sqlite3.wasm +/test/sqflite_sw_v1.js diff --git a/packages_web/sqflite_common_ffi_web_test/test/sqflite_ffi_web_test.dart b/packages_web/sqflite_common_ffi_web_test/test/sqflite_ffi_web_test.dart index 23c22444..a8c16e16 100644 --- a/packages_web/sqflite_common_ffi_web_test/test/sqflite_ffi_web_test.dart +++ b/packages_web/sqflite_common_ffi_web_test/test/sqflite_ffi_web_test.dart @@ -5,7 +5,9 @@ import 'package:sqflite_common_test/all_test.dart' as all; import 'package:sqflite_common_test/sqflite_test.dart'; import 'package:test/test.dart'; -var _factory = databaseFactoryFfiWeb; +var _factory = createDatabaseFactoryFfiWeb( + options: + SqfliteFfiWebOptions(sharedWorkerUri: Uri.parse('sqflite_sw_v1.js'))); class SqfliteFfiWebTestContext extends SqfliteLocalTestContext { SqfliteFfiWebTestContext() : super(databaseFactory: _factory); diff --git a/packages_web/sqflite_common_ffi_web_test/tool/setup_web_tests.dart b/packages_web/sqflite_common_ffi_web_test/tool/setup_web_tests.dart new file mode 100644 index 00000000..7899b8d1 --- /dev/null +++ b/packages_web/sqflite_common_ffi_web_test/tool/setup_web_tests.dart @@ -0,0 +1,5 @@ +import 'package:sqflite_common_ffi_web/src/setup/setup.dart'; + +Future main() async { + await setupBinaries(options: SetupOptions(verbose: true, dir: 'test')); +} diff --git a/packages_web/sqflite_common_ffi_web_test/tool/setup_web_tests_force.dart b/packages_web/sqflite_common_ffi_web_test/tool/setup_web_tests_force.dart new file mode 100644 index 00000000..8fb39f01 --- /dev/null +++ b/packages_web/sqflite_common_ffi_web_test/tool/setup_web_tests_force.dart @@ -0,0 +1,6 @@ +import 'package:sqflite_common_ffi_web/src/setup/setup.dart'; + +Future main() async { + await setupBinaries( + options: SetupOptions(verbose: true, dir: 'test', force: true)); +} diff --git a/sqflite_common_test/lib/sqflite_protocol_test.dart b/sqflite_common_test/lib/sqflite_protocol_test.dart index f8dfb936..94dddd2c 100644 --- a/sqflite_common_test/lib/sqflite_protocol_test.dart +++ b/sqflite_common_test/lib/sqflite_protocol_test.dart @@ -56,17 +56,20 @@ void run(SqfliteTestContext? context) { await scenario.factory.databaseExists(inMemoryDatabasePath); scenario.end(); }); - test('delete', () async { - final scenario = wrapStartScenario(factory, [ - [ - 'deleteDatabase', - {'path': ':memory:'}, - null - ] - ]); - await scenario.factory.deleteDatabase(inMemoryDatabasePath); - scenario.end(); - }); + test( + 'delete', + () async { + final scenario = wrapStartScenario(factory, [ + [ + 'deleteDatabase', + {'path': ':memory:'}, + null + ] + ]); + await scenario.factory.deleteDatabase(inMemoryDatabasePath); + scenario.end(); + }, + ); test('execute', () async { final scenario = wrapStartScenario(factory, [ protocolOpenStep,