Merge pull request #494 from davidmartos96/integration_test_improvement

Integration tests improvements
This commit is contained in:
Simon Binder 2020-04-15 21:40:50 +02:00 committed by GitHub
commit 3a53c60132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -30,5 +30,6 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final dbPath = await getDatabasesPath();
Directory(dbPath).createSync(recursive: true);
runAllTests(FfiExecutor(dbPath));
}

View File

@ -35,9 +35,15 @@ Future<void> main() async {
// Additional integration test for flutter: Test loading a database from asset
test('can load a database from asset', () async {
final databasesPath = await getDatabasesPath();
final dbFile = File(join(databasesPath, 'app_from_asset.db'));
if (await dbFile.exists()) {
await dbFile.delete();
}
var didCallCreator = false;
final executor = FlutterQueryExecutor.inDatabaseFolder(
path: 'app_from_asset.db',
final executor = FlutterQueryExecutor(
path: dbFile.path,
singleInstance: true,
creator: (file) async {
final content = await rootBundle.load('test_asset.db');