mirror of https://github.com/AMT-Cheif/drift.git
Fix tests
This commit is contained in:
parent
f379ca0b25
commit
6c439a3a0f
|
@ -63,8 +63,6 @@ void main() {
|
|||
final second = db.select(db.users).watch();
|
||||
expect(second, emits(isEmpty));
|
||||
|
||||
// calling executor.dialect is ok, it's needed to construct the statement
|
||||
verify(executor.dialect);
|
||||
verifyNoMoreInteractions(executor);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@TestOn('vm')
|
||||
import 'package:async/async.dart';
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:drift/remote.dart';
|
||||
|
|
|
@ -9,6 +9,7 @@ class MockExecutor extends Mock implements QueryExecutor {
|
|||
|
||||
MockExecutor([this.openingDetails]) {
|
||||
when(dialect).thenReturn(SqlDialect.sqlite);
|
||||
when(supportsBigInt).thenReturn(true);
|
||||
when(runSelect(any, any)).thenAnswer((_) {
|
||||
assert(_opened);
|
||||
return Future.value([]);
|
||||
|
@ -55,6 +56,9 @@ class MockExecutor extends Mock implements QueryExecutor {
|
|||
SqlDialect get dialect =>
|
||||
_nsm(Invocation.getter(#dialect), SqlDialect.sqlite);
|
||||
|
||||
@override
|
||||
bool get supportsBigInt => _nsm(Invocation.getter(#supportsBigInt), true);
|
||||
|
||||
@override
|
||||
Future<bool> ensureOpen(QueryExecutorUser? user) =>
|
||||
_nsm(Invocation.method(#ensureOpen, [user]), Future.value(true));
|
||||
|
|
|
@ -7,6 +7,7 @@ dart format -o none --set-exit-if-changed .
|
|||
dart analyze --fatal-infos --fatal-warnings
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
dart test
|
||||
dart test -p chrome
|
||||
|
||||
cd ../drift_dev
|
||||
rm -rf .dart_tool
|
||||
|
|
Loading…
Reference in New Issue