From 4f2268410e01a15cfe1fb08b210ff129e9172066 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Thu, 6 May 2021 16:50:31 +0200 Subject: [PATCH] Migrate VM and web integration tests --- .../tests/lib/database/database.dart | 14 +- .../tests/lib/database/database.g.dart | 258 ++++++++---------- .../tests/lib/suite/custom_objects.dart | 2 +- .../tests/lib/suite/transactions.dart | 1 - extras/integration_tests/tests/pubspec.yaml | 8 +- extras/integration_tests/vm/pubspec.yaml | 4 +- 6 files changed, 124 insertions(+), 163 deletions(-) diff --git a/extras/integration_tests/tests/lib/database/database.dart b/extras/integration_tests/tests/lib/database/database.dart index 5439ecde..d55f842b 100644 --- a/extras/integration_tests/tests/lib/database/database.dart +++ b/extras/integration_tests/tests/lib/database/database.dart @@ -52,7 +52,7 @@ class Preferences { class PreferenceConverter extends TypeConverter { const PreferenceConverter(); @override - Preferences mapToDart(String fromDb) { + Preferences? mapToDart(String? fromDb) { if (fromDb == null) { return null; } @@ -60,7 +60,7 @@ class PreferenceConverter extends TypeConverter { } @override - String mapToSql(Preferences value) { + String? mapToSql(Preferences? value) { if (value == null) { return null; } @@ -100,12 +100,12 @@ class Database extends _$Database { : this(DatabaseConnection.fromExecutor(db)); /// It will be set in the onUpgrade callback. Null if no migration occurred - int schemaVersionChangedFrom; + int? schemaVersionChangedFrom; /// It will be set in the onUpgrade callback. Null if no migration occurred - int schemaVersionChangedTo; + int? schemaVersionChangedTo; - MigrationStrategy overrideMigration; + MigrationStrategy? overrideMigration; @override MigrationStrategy get migration { @@ -169,9 +169,9 @@ class Database extends _$Database { return into(users).insert(user); } - Selectable friendsOf(int id) => friendshipsOf(id).map((r) => r.user); + Selectable friendsOf(int id) => friendshipsOf(id).map((r) => r.user!); - Future makeFriends(User a, User b, {bool goodFriends}) async { + Future makeFriends(User a, User b, {bool? goodFriends}) async { var friendsValue = const Value.absent(); if (goodFriends != null) { friendsValue = Value(goodFriends); diff --git a/extras/integration_tests/tests/lib/database/database.g.dart b/extras/integration_tests/tests/lib/database/database.g.dart index fd91f9aa..6ba42579 100644 --- a/extras/integration_tests/tests/lib/database/database.g.dart +++ b/extras/integration_tests/tests/lib/database/database.g.dart @@ -31,61 +31,51 @@ class User extends DataClass implements Insertable { /// /// Mapped from json `born_on` final DateTime birthDate; - final Uint8List profilePicture; - final Preferences preferences; + final Uint8List? profilePicture; + final Preferences? preferences; User( - {@required this.id, - @required this.name, - @required this.birthDate, + {required this.id, + required this.name, + required this.birthDate, this.profilePicture, this.preferences}); factory User.fromData(Map data, GeneratedDatabase db, - {String prefix}) { + {String? prefix}) { final effectivePrefix = prefix ?? ''; - final intType = db.typeSystem.forDartType(); - final stringType = db.typeSystem.forDartType(); - final dateTimeType = db.typeSystem.forDartType(); - final uint8ListType = db.typeSystem.forDartType(); return User( - id: intType.mapFromDatabaseResponse(data['${effectivePrefix}id']), - name: stringType.mapFromDatabaseResponse(data['${effectivePrefix}name']), - birthDate: dateTimeType - .mapFromDatabaseResponse(data['${effectivePrefix}birth_date']), - profilePicture: uint8ListType + id: const IntType() + .mapFromDatabaseResponse(data['${effectivePrefix}id'])!, + name: const StringType() + .mapFromDatabaseResponse(data['${effectivePrefix}name'])!, + birthDate: const DateTimeType() + .mapFromDatabaseResponse(data['${effectivePrefix}birth_date'])!, + profilePicture: const BlobType() .mapFromDatabaseResponse(data['${effectivePrefix}profile_picture']), - preferences: $UsersTable.$converter0.mapToDart(stringType + preferences: $UsersTable.$converter0.mapToDart(const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}preferences'])), ); } @override Map toColumns(bool nullToAbsent) { final map = {}; - if (!nullToAbsent || id != null) { - map['id'] = Variable(id); - } - if (!nullToAbsent || name != null) { - map['name'] = Variable(name); - } - if (!nullToAbsent || birthDate != null) { - map['birth_date'] = Variable(birthDate); - } + map['id'] = Variable(id); + map['name'] = Variable(name); + map['birth_date'] = Variable(birthDate); if (!nullToAbsent || profilePicture != null) { - map['profile_picture'] = Variable(profilePicture); + map['profile_picture'] = Variable(profilePicture); } if (!nullToAbsent || preferences != null) { final converter = $UsersTable.$converter0; - map['preferences'] = Variable(converter.mapToSql(preferences)); + map['preferences'] = Variable(converter.mapToSql(preferences)); } return map; } UsersCompanion toCompanion(bool nullToAbsent) { return UsersCompanion( - id: id == null && nullToAbsent ? const Value.absent() : Value(id), - name: name == null && nullToAbsent ? const Value.absent() : Value(name), - birthDate: birthDate == null && nullToAbsent - ? const Value.absent() - : Value(birthDate), + id: Value(id), + name: Value(name), + birthDate: Value(birthDate), profilePicture: profilePicture == null && nullToAbsent ? const Value.absent() : Value(profilePicture), @@ -96,34 +86,34 @@ class User extends DataClass implements Insertable { } factory User.fromJson(Map json, - {ValueSerializer serializer}) { + {ValueSerializer? serializer}) { serializer ??= moorRuntimeOptions.defaultSerializer; return User( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), birthDate: serializer.fromJson(json['born_on']), - profilePicture: serializer.fromJson(json['profilePicture']), - preferences: serializer.fromJson(json['preferences']), + profilePicture: serializer.fromJson(json['profilePicture']), + preferences: serializer.fromJson(json['preferences']), ); } @override - Map toJson({ValueSerializer serializer}) { + Map toJson({ValueSerializer? serializer}) { serializer ??= moorRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), 'born_on': serializer.toJson(birthDate), - 'profilePicture': serializer.toJson(profilePicture), - 'preferences': serializer.toJson(preferences), + 'profilePicture': serializer.toJson(profilePicture), + 'preferences': serializer.toJson(preferences), }; } User copyWith( - {int id, - String name, - DateTime birthDate, - Uint8List profilePicture, - Preferences preferences}) => + {int? id, + String? name, + DateTime? birthDate, + Uint8List? profilePicture, + Preferences? preferences}) => User( id: id ?? this.id, name: name ?? this.name, @@ -165,8 +155,8 @@ class UsersCompanion extends UpdateCompanion { final Value id; final Value name; final Value birthDate; - final Value profilePicture; - final Value preferences; + final Value profilePicture; + final Value preferences; const UsersCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), @@ -176,18 +166,18 @@ class UsersCompanion extends UpdateCompanion { }); UsersCompanion.insert({ this.id = const Value.absent(), - @required String name, - @required DateTime birthDate, + required String name, + required DateTime birthDate, this.profilePicture = const Value.absent(), this.preferences = const Value.absent(), }) : name = Value(name), birthDate = Value(birthDate); static Insertable custom({ - Expression id, - Expression name, - Expression birthDate, - Expression profilePicture, - Expression preferences, + Expression? id, + Expression? name, + Expression? birthDate, + Expression? profilePicture, + Expression? preferences, }) { return RawValuesInsertable({ if (id != null) 'id': id, @@ -199,11 +189,11 @@ class UsersCompanion extends UpdateCompanion { } UsersCompanion copyWith( - {Value id, - Value name, - Value birthDate, - Value profilePicture, - Value preferences}) { + {Value? id, + Value? name, + Value? birthDate, + Value? profilePicture, + Value? preferences}) { return UsersCompanion( id: id ?? this.id, name: name ?? this.name, @@ -226,12 +216,12 @@ class UsersCompanion extends UpdateCompanion { map['birth_date'] = Variable(birthDate.value); } if (profilePicture.present) { - map['profile_picture'] = Variable(profilePicture.value); + map['profile_picture'] = Variable(profilePicture.value); } if (preferences.present) { final converter = $UsersTable.$converter0; map['preferences'] = - Variable(converter.mapToSql(preferences.value)); + Variable(converter.mapToSql(preferences.value)); } return map; } @@ -251,21 +241,19 @@ class UsersCompanion extends UpdateCompanion { class $UsersTable extends Users with TableInfo<$UsersTable, User> { final GeneratedDatabase _db; - final String _alias; + final String? _alias; $UsersTable(this._db, [this._alias]); final VerificationMeta _idMeta = const VerificationMeta('id'); - GeneratedIntColumn _id; @override - GeneratedIntColumn get id => _id ??= _constructId(); + late final GeneratedIntColumn id = _constructId(); GeneratedIntColumn _constructId() { return GeneratedIntColumn('id', $tableName, false, hasAutoIncrement: true, declaredAsPrimaryKey: true); } final VerificationMeta _nameMeta = const VerificationMeta('name'); - GeneratedTextColumn _name; @override - GeneratedTextColumn get name => _name ??= _constructName(); + late final GeneratedTextColumn name = _constructName(); GeneratedTextColumn _constructName() { return GeneratedTextColumn( 'name', @@ -275,9 +263,8 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> { } final VerificationMeta _birthDateMeta = const VerificationMeta('birthDate'); - GeneratedDateTimeColumn _birthDate; @override - GeneratedDateTimeColumn get birthDate => _birthDate ??= _constructBirthDate(); + late final GeneratedDateTimeColumn birthDate = _constructBirthDate(); GeneratedDateTimeColumn _constructBirthDate() { return GeneratedDateTimeColumn( 'birth_date', @@ -288,10 +275,8 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> { final VerificationMeta _profilePictureMeta = const VerificationMeta('profilePicture'); - GeneratedBlobColumn _profilePicture; @override - GeneratedBlobColumn get profilePicture => - _profilePicture ??= _constructProfilePicture(); + late final GeneratedBlobColumn profilePicture = _constructProfilePicture(); GeneratedBlobColumn _constructProfilePicture() { return GeneratedBlobColumn( 'profile_picture', @@ -302,10 +287,8 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> { final VerificationMeta _preferencesMeta = const VerificationMeta('preferences'); - GeneratedTextColumn _preferences; @override - GeneratedTextColumn get preferences => - _preferences ??= _constructPreferences(); + late final GeneratedTextColumn preferences = _constructPreferences(); GeneratedTextColumn _constructPreferences() { return GeneratedTextColumn( 'preferences', @@ -329,17 +312,17 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id'], _idMeta)); + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name'], _nameMeta)); + _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('birth_date')) { context.handle(_birthDateMeta, - birthDate.isAcceptableOrUnknown(data['birth_date'], _birthDateMeta)); + birthDate.isAcceptableOrUnknown(data['birth_date']!, _birthDateMeta)); } else if (isInserting) { context.missing(_birthDateMeta); } @@ -347,7 +330,7 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> { context.handle( _profilePictureMeta, profilePicture.isAcceptableOrUnknown( - data['profile_picture'], _profilePictureMeta)); + data['profile_picture']!, _profilePictureMeta)); } context.handle(_preferencesMeta, const VerificationResult.success()); return context; @@ -356,7 +339,7 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> { @override Set get $primaryKey => {id}; @override - User map(Map data, {String tablePrefix}) { + User map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : null; return User.fromData(data, _db, prefix: effectivePrefix); } @@ -375,54 +358,40 @@ class Friendship extends DataClass implements Insertable { final int secondUser; final bool reallyGoodFriends; Friendship( - {@required this.firstUser, - @required this.secondUser, - @required this.reallyGoodFriends}); + {required this.firstUser, + required this.secondUser, + required this.reallyGoodFriends}); factory Friendship.fromData(Map data, GeneratedDatabase db, - {String prefix}) { + {String? prefix}) { final effectivePrefix = prefix ?? ''; - final intType = db.typeSystem.forDartType(); - final boolType = db.typeSystem.forDartType(); return Friendship( - firstUser: - intType.mapFromDatabaseResponse(data['${effectivePrefix}first_user']), - secondUser: intType - .mapFromDatabaseResponse(data['${effectivePrefix}second_user']), - reallyGoodFriends: boolType.mapFromDatabaseResponse( - data['${effectivePrefix}really_good_friends']), + firstUser: const IntType() + .mapFromDatabaseResponse(data['${effectivePrefix}first_user'])!, + secondUser: const IntType() + .mapFromDatabaseResponse(data['${effectivePrefix}second_user'])!, + reallyGoodFriends: const BoolType().mapFromDatabaseResponse( + data['${effectivePrefix}really_good_friends'])!, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; - if (!nullToAbsent || firstUser != null) { - map['first_user'] = Variable(firstUser); - } - if (!nullToAbsent || secondUser != null) { - map['second_user'] = Variable(secondUser); - } - if (!nullToAbsent || reallyGoodFriends != null) { - map['really_good_friends'] = Variable(reallyGoodFriends); - } + map['first_user'] = Variable(firstUser); + map['second_user'] = Variable(secondUser); + map['really_good_friends'] = Variable(reallyGoodFriends); return map; } FriendshipsCompanion toCompanion(bool nullToAbsent) { return FriendshipsCompanion( - firstUser: firstUser == null && nullToAbsent - ? const Value.absent() - : Value(firstUser), - secondUser: secondUser == null && nullToAbsent - ? const Value.absent() - : Value(secondUser), - reallyGoodFriends: reallyGoodFriends == null && nullToAbsent - ? const Value.absent() - : Value(reallyGoodFriends), + firstUser: Value(firstUser), + secondUser: Value(secondUser), + reallyGoodFriends: Value(reallyGoodFriends), ); } factory Friendship.fromJson(Map json, - {ValueSerializer serializer}) { + {ValueSerializer? serializer}) { serializer ??= moorRuntimeOptions.defaultSerializer; return Friendship( firstUser: serializer.fromJson(json['firstUser']), @@ -431,7 +400,7 @@ class Friendship extends DataClass implements Insertable { ); } @override - Map toJson({ValueSerializer serializer}) { + Map toJson({ValueSerializer? serializer}) { serializer ??= moorRuntimeOptions.defaultSerializer; return { 'firstUser': serializer.toJson(firstUser), @@ -441,7 +410,7 @@ class Friendship extends DataClass implements Insertable { } Friendship copyWith( - {int firstUser, int secondUser, bool reallyGoodFriends}) => + {int? firstUser, int? secondUser, bool? reallyGoodFriends}) => Friendship( firstUser: firstUser ?? this.firstUser, secondUser: secondUser ?? this.secondUser, @@ -479,15 +448,15 @@ class FriendshipsCompanion extends UpdateCompanion { this.reallyGoodFriends = const Value.absent(), }); FriendshipsCompanion.insert({ - @required int firstUser, - @required int secondUser, + required int firstUser, + required int secondUser, this.reallyGoodFriends = const Value.absent(), }) : firstUser = Value(firstUser), secondUser = Value(secondUser); static Insertable custom({ - Expression firstUser, - Expression secondUser, - Expression reallyGoodFriends, + Expression? firstUser, + Expression? secondUser, + Expression? reallyGoodFriends, }) { return RawValuesInsertable({ if (firstUser != null) 'first_user': firstUser, @@ -497,9 +466,9 @@ class FriendshipsCompanion extends UpdateCompanion { } FriendshipsCompanion copyWith( - {Value firstUser, - Value secondUser, - Value reallyGoodFriends}) { + {Value? firstUser, + Value? secondUser, + Value? reallyGoodFriends}) { return FriendshipsCompanion( firstUser: firstUser ?? this.firstUser, secondUser: secondUser ?? this.secondUser, @@ -536,12 +505,11 @@ class FriendshipsCompanion extends UpdateCompanion { class $FriendshipsTable extends Friendships with TableInfo<$FriendshipsTable, Friendship> { final GeneratedDatabase _db; - final String _alias; + final String? _alias; $FriendshipsTable(this._db, [this._alias]); final VerificationMeta _firstUserMeta = const VerificationMeta('firstUser'); - GeneratedIntColumn _firstUser; @override - GeneratedIntColumn get firstUser => _firstUser ??= _constructFirstUser(); + late final GeneratedIntColumn firstUser = _constructFirstUser(); GeneratedIntColumn _constructFirstUser() { return GeneratedIntColumn( 'first_user', @@ -551,9 +519,8 @@ class $FriendshipsTable extends Friendships } final VerificationMeta _secondUserMeta = const VerificationMeta('secondUser'); - GeneratedIntColumn _secondUser; @override - GeneratedIntColumn get secondUser => _secondUser ??= _constructSecondUser(); + late final GeneratedIntColumn secondUser = _constructSecondUser(); GeneratedIntColumn _constructSecondUser() { return GeneratedIntColumn( 'second_user', @@ -564,10 +531,9 @@ class $FriendshipsTable extends Friendships final VerificationMeta _reallyGoodFriendsMeta = const VerificationMeta('reallyGoodFriends'); - GeneratedBoolColumn _reallyGoodFriends; @override - GeneratedBoolColumn get reallyGoodFriends => - _reallyGoodFriends ??= _constructReallyGoodFriends(); + late final GeneratedBoolColumn reallyGoodFriends = + _constructReallyGoodFriends(); GeneratedBoolColumn _constructReallyGoodFriends() { return GeneratedBoolColumn('really_good_friends', $tableName, false, defaultValue: const Constant(false)); @@ -589,7 +555,7 @@ class $FriendshipsTable extends Friendships final data = instance.toColumns(true); if (data.containsKey('first_user')) { context.handle(_firstUserMeta, - firstUser.isAcceptableOrUnknown(data['first_user'], _firstUserMeta)); + firstUser.isAcceptableOrUnknown(data['first_user']!, _firstUserMeta)); } else if (isInserting) { context.missing(_firstUserMeta); } @@ -597,7 +563,7 @@ class $FriendshipsTable extends Friendships context.handle( _secondUserMeta, secondUser.isAcceptableOrUnknown( - data['second_user'], _secondUserMeta)); + data['second_user']!, _secondUserMeta)); } else if (isInserting) { context.missing(_secondUserMeta); } @@ -605,7 +571,7 @@ class $FriendshipsTable extends Friendships context.handle( _reallyGoodFriendsMeta, reallyGoodFriends.isAcceptableOrUnknown( - data['really_good_friends'], _reallyGoodFriendsMeta)); + data['really_good_friends']!, _reallyGoodFriendsMeta)); } return context; } @@ -613,7 +579,7 @@ class $FriendshipsTable extends Friendships @override Set get $primaryKey => {firstUser, secondUser}; @override - Friendship map(Map data, {String tablePrefix}) { + Friendship map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : null; return Friendship.fromData(data, _db, prefix: effectivePrefix); } @@ -627,14 +593,12 @@ class $FriendshipsTable extends Friendships abstract class _$Database extends GeneratedDatabase { _$Database(QueryExecutor e) : super(SqlTypeSystem.defaultInstance, e); _$Database.connect(DatabaseConnection c) : super.connect(c); - $UsersTable _users; - $UsersTable get users => _users ??= $UsersTable(this); - $FriendshipsTable _friendships; - $FriendshipsTable get friendships => _friendships ??= $FriendshipsTable(this); + late final $UsersTable users = $UsersTable(this); + late final $FriendshipsTable friendships = $FriendshipsTable(this); Selectable mostPopularUsers(int amount) { return customSelect( 'SELECT * FROM users u ORDER BY (SELECT COUNT(*) FROM friendships WHERE first_user = u.id OR second_user = u.id) DESC LIMIT :amount', - variables: [Variable.withInt(amount)], + variables: [Variable(amount)], readsFrom: {users, friendships}).map(users.mapFromRow); } @@ -642,20 +606,20 @@ abstract class _$Database extends GeneratedDatabase { return customSelect( 'SELECT COUNT(*) FROM friendships f WHERE f.really_good_friends AND (f.first_user = :user OR f.second_user = :user)', variables: [ - Variable.withInt(user) + Variable(user) ], readsFrom: { friendships - }).map((QueryRow row) => row.readInt('COUNT(*)')); + }).map((QueryRow row) => row.read('COUNT(*)')); } Selectable friendshipsOf(int user) { return customSelect( 'SELECT \n f.really_good_friends, "user"."id" AS "nested_0.id", "user"."name" AS "nested_0.name", "user"."birth_date" AS "nested_0.birth_date", "user"."profile_picture" AS "nested_0.profile_picture", "user"."preferences" AS "nested_0.preferences"\n FROM friendships f\n INNER JOIN users user ON user.id IN (f.first_user, f.second_user) AND\n user.id != :user\n WHERE (f.first_user = :user OR f.second_user = :user)', - variables: [Variable.withInt(user)], + variables: [Variable(user)], readsFrom: {friendships, users}).map((QueryRow row) { return FriendshipsOfResult( - reallyGoodFriends: row.readBool('really_good_friends'), + reallyGoodFriends: row.read('really_good_friends'), user: users.mapFromRowOrNull(row, tablePrefix: 'nested_0'), ); }); @@ -664,14 +628,14 @@ abstract class _$Database extends GeneratedDatabase { Selectable userCount() { return customSelect('SELECT COUNT(id) FROM users', variables: [], - readsFrom: {users}).map((QueryRow row) => row.readInt('COUNT(id)')); + readsFrom: {users}).map((QueryRow row) => row.read('COUNT(id)')); } - Selectable settingsFor(int user) { + Selectable settingsFor(int user) { return customSelect('SELECT preferences FROM users WHERE id = :user', - variables: [Variable.withInt(user)], readsFrom: {users}) - .map((QueryRow row) => - $UsersTable.$converter0.mapToDart(row.readString('preferences'))); + variables: [Variable(user)], readsFrom: {users}) + .map((QueryRow row) => $UsersTable.$converter0 + .mapToDart(row.read('preferences'))); } Selectable usersById(List var1) { @@ -679,7 +643,7 @@ abstract class _$Database extends GeneratedDatabase { final expandedvar1 = $expandVar($arrayStartIndex, var1.length); $arrayStartIndex += var1.length; return customSelect('SELECT * FROM users WHERE id IN ($expandedvar1)', - variables: [for (var $ in var1) Variable.withInt($)], + variables: [for (var $ in var1) Variable($)], readsFrom: {users}).map(users.mapFromRow); } @@ -691,9 +655,9 @@ abstract class _$Database extends GeneratedDatabase { class FriendshipsOfResult { final bool reallyGoodFriends; - final User user; + final User? user; FriendshipsOfResult({ - this.reallyGoodFriends, + required this.reallyGoodFriends, this.user, }); @override diff --git a/extras/integration_tests/tests/lib/suite/custom_objects.dart b/extras/integration_tests/tests/lib/suite/custom_objects.dart index 475fd596..cd17c631 100644 --- a/extras/integration_tests/tests/lib/suite/custom_objects.dart +++ b/extras/integration_tests/tests/lib/suite/custom_objects.dart @@ -13,7 +13,7 @@ void customObjectTests(TestExecutor executor) { await db.updateSettings(1, Preferences(true)); preferences = await db.settingsFor(1).getSingle(); - expect(preferences.receiveEmails, true); + expect(preferences?.receiveEmails, true); await db.close(); }); diff --git a/extras/integration_tests/tests/lib/suite/transactions.dart b/extras/integration_tests/tests/lib/suite/transactions.dart index 410e86af..a6307648 100644 --- a/extras/integration_tests/tests/lib/suite/transactions.dart +++ b/extras/integration_tests/tests/lib/suite/transactions.dart @@ -42,7 +42,6 @@ void transactionTests(TestExecutor executor) { await db.makeFriends(dash, florian, goodFriends: true); throw Exception('nope i made a mistake please rollback thank you'); }); - fail('the transaction should have thrown!'); } on Exception catch (_) {} final countResult = await db.userCount().getSingle(); diff --git a/extras/integration_tests/tests/pubspec.yaml b/extras/integration_tests/tests/pubspec.yaml index 6e5d20e6..dd726d83 100644 --- a/extras/integration_tests/tests/pubspec.yaml +++ b/extras/integration_tests/tests/pubspec.yaml @@ -5,16 +5,14 @@ description: A sample command-line application. # author: Simon Binder environment: - sdk: '>=2.4.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: - moor: - path: - ../../../moor + moor: ^4.0.0 json_annotation: ^4.0.0 dev_dependencies: build_runner: ^1.7.2 - moor_generator: ^2.0.0 + moor_generator: ^4.0.0 json_serializable: ^4.0.0 test: diff --git a/extras/integration_tests/vm/pubspec.yaml b/extras/integration_tests/vm/pubspec.yaml index c2f9a7fe..884e1849 100644 --- a/extras/integration_tests/vm/pubspec.yaml +++ b/extras/integration_tests/vm/pubspec.yaml @@ -5,14 +5,14 @@ description: A sample command-line application. # author: Simon Binder environment: - sdk: '>=2.4.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: tests: path: ../tests dev_dependencies: - test: ^1.5.0 + test: ^1.16.0 dependency_overrides: moor: