From 2ae33bf971880096b38cfae7fca7d71b5496d9c1 Mon Sep 17 00:00:00 2001 From: tusharmathur-wk Date: Wed, 22 May 2024 16:19:54 +0530 Subject: [PATCH] fixed analyzer warnings --- .../over_react_flux.over_react.g.dart | 2 + test/mockito.dart | 16 - test/mockito.mocks.dart | 443 ------------------ .../shared_error_boundary_tests.dart | 38 +- .../shared_error_boundary_tests.dart | 38 +- test/over_react/shared/map_proxy_tests.dart | 3 +- test/vm_tests/builder/codegen_test.dart | 132 +++--- .../builder/declaration_parsing_test.dart | 46 +- .../parsing/error_collection_test.dart | 3 +- 9 files changed, 129 insertions(+), 592 deletions(-) delete mode 100644 test/mockito.dart delete mode 100644 test/mockito.mocks.dart diff --git a/lib/src/over_react_redux/over_react_flux.over_react.g.dart b/lib/src/over_react_redux/over_react_flux.over_react.g.dart index afd92756d..f3887e9e7 100644 --- a/lib/src/over_react_redux/over_react_flux.over_react.g.dart +++ b/lib/src/over_react_redux/over_react_flux.over_react.g.dart @@ -16,11 +16,13 @@ abstract class ConnectFluxPropsMixin /// @override + @disableRequiredPropValidation TActions get actions => (props[_$key__actions___$ConnectFluxPropsMixin] ?? null) as TActions; /// @override + @disableRequiredPropValidation set actions(TActions value) => props[_$key__actions___$ConnectFluxPropsMixin] = value; /* GENERATED CONSTANTS */ diff --git a/test/mockito.dart b/test/mockito.dart deleted file mode 100644 index 5c4911147..000000000 --- a/test/mockito.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:logging/logging.dart'; -import 'package:mockito/annotations.dart'; - -@GenerateMocks([], customMocks: [ - MockSpec(returnNullOnMissingStub: true), - MockSpec(fallbackGenerators: { - #update: mapUpdateShim, - #putIfAbsent: mapPutIfAbsentShim, - }, returnNullOnMissingStub: true) -]) -void main() {} - -String mapUpdateShim(K key, V Function(V value)? update, - {V Function()? ifAbsent}) => - 'value'; -String mapPutIfAbsentShim(K key, V Function()? ifAbsent) => 'value'; diff --git a/test/mockito.mocks.dart b/test/mockito.mocks.dart deleted file mode 100644 index ee78d8682..000000000 --- a/test/mockito.mocks.dart +++ /dev/null @@ -1,443 +0,0 @@ -// Mocks generated by Mockito 5.4.0 from annotations -// in over_react/test/mockito.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; - -import 'package:logging/src/level.dart' as _i2; -import 'package:logging/src/log_record.dart' as _i5; -import 'package:logging/src/logger.dart' as _i3; -import 'package:mocktail/mocktail.dart' as _i1; - -import 'mockito.dart' as _i6; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeLevel_0 extends _i1.SmartFake implements _i2.Level { - _FakeLevel_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -/// A class which mocks [Logger]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockLogger extends _i1.Mock implements _i3.Logger { - @override - String get name => (super.noSuchMethod( - Invocation.getter(#name), - returnValue: '', - ) as String); - @override - Map get children => (super.noSuchMethod( - Invocation.getter(#children), - returnValue: {}, - ) as Map); - @override - String get fullName => (super.noSuchMethod( - Invocation.getter(#fullName), - returnValue: '', - ) as String); - @override - _i2.Level get level => (super.noSuchMethod( - Invocation.getter(#level), - returnValue: _FakeLevel_0( - this, - Invocation.getter(#level), - ), - ) as _i2.Level); - @override - set level(_i2.Level? value) => super.noSuchMethod( - Invocation.setter( - #level, - value, - ), - returnValueForMissingStub: null, - ); - @override - _i4.Stream<_i5.LogRecord> get onRecord => (super.noSuchMethod( - Invocation.getter(#onRecord), - returnValue: _i4.Stream<_i5.LogRecord>.empty(), - ) as _i4.Stream<_i5.LogRecord>); - @override - void clearListeners() => super.noSuchMethod( - Invocation.method( - #clearListeners, - [], - ), - returnValueForMissingStub: null, - ); - @override - bool isLoggable(_i2.Level? value) => (super.noSuchMethod( - Invocation.method( - #isLoggable, - [value], - ), - returnValue: false, - ) as bool); - @override - void log( - _i2.Level? logLevel, - Object? message, [ - Object? error, - StackTrace? stackTrace, - _i4.Zone? zone, - ]) => - super.noSuchMethod( - Invocation.method( - #log, - [ - logLevel, - message, - error, - stackTrace, - zone, - ], - ), - returnValueForMissingStub: null, - ); - @override - void finest( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #finest, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void finer( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #finer, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void fine( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #fine, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void config( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #config, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void info( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #info, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void warning( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #warning, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void severe( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #severe, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); - @override - void shout( - Object? message, [ - Object? error, - StackTrace? stackTrace, - ]) => - super.noSuchMethod( - Invocation.method( - #shout, - [ - message, - error, - stackTrace, - ], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [Map]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockMap extends _i1.Mock implements Map { - @override - Iterable> get entries => (super.noSuchMethod( - Invocation.getter(#entries), - returnValue: >[], - ) as Iterable>); - @override - Iterable get keys => (super.noSuchMethod( - Invocation.getter(#keys), - returnValue: [], - ) as Iterable); - @override - Iterable get values => (super.noSuchMethod( - Invocation.getter(#values), - returnValue: [], - ) as Iterable); - @override - int get length => (super.noSuchMethod( - Invocation.getter(#length), - returnValue: 0, - ) as int); - @override - bool get isEmpty => (super.noSuchMethod( - Invocation.getter(#isEmpty), - returnValue: false, - ) as bool); - @override - bool get isNotEmpty => (super.noSuchMethod( - Invocation.getter(#isNotEmpty), - returnValue: false, - ) as bool); - @override - Map cast() => (super.noSuchMethod( - Invocation.method( - #cast, - [], - ), - returnValue: {}, - ) as Map); - @override - bool containsValue(Object? value) => (super.noSuchMethod( - Invocation.method( - #containsValue, - [value], - ), - returnValue: false, - ) as bool); - @override - bool containsKey(Object? key) => (super.noSuchMethod( - Invocation.method( - #containsKey, - [key], - ), - returnValue: false, - ) as bool); - @override - void operator []=( - K? key, - V? value, - ) => - super.noSuchMethod( - Invocation.method( - #[]=, - [ - key, - value, - ], - ), - returnValueForMissingStub: null, - ); - @override - Map map( - MapEntry Function( - K, - V, - )? - convert) => - (super.noSuchMethod( - Invocation.method( - #map, - [convert], - ), - returnValue: {}, - ) as Map); - @override - void addEntries(Iterable>? newEntries) => super.noSuchMethod( - Invocation.method( - #addEntries, - [newEntries], - ), - returnValueForMissingStub: null, - ); - @override - V update( - K? key, - V Function(V)? update, { - V Function()? ifAbsent, - }) => - (super.noSuchMethod( - Invocation.method( - #update, - [ - key, - update, - ], - {#ifAbsent: ifAbsent}, - ), - returnValue: _i6.mapUpdateShim( - key, - update, - ifAbsent: ifAbsent, - ), - ) as V); - @override - void updateAll( - V Function( - K, - V, - )? - update) => - super.noSuchMethod( - Invocation.method( - #updateAll, - [update], - ), - returnValueForMissingStub: null, - ); - @override - void removeWhere( - bool Function( - K, - V, - )? - test) => - super.noSuchMethod( - Invocation.method( - #removeWhere, - [test], - ), - returnValueForMissingStub: null, - ); - @override - V putIfAbsent( - K? key, - V Function()? ifAbsent, - ) => - (super.noSuchMethod( - Invocation.method( - #putIfAbsent, - [ - key, - ifAbsent, - ], - ), - returnValue: _i6.mapPutIfAbsentShim( - key, - ifAbsent, - ), - ) as V); - @override - void addAll(Map? other) => super.noSuchMethod( - Invocation.method( - #addAll, - [other], - ), - returnValueForMissingStub: null, - ); - @override - void clear() => super.noSuchMethod( - Invocation.method( - #clear, - [], - ), - returnValueForMissingStub: null, - ); - @override - void forEach( - void Function( - K, - V, - )? - action) => - super.noSuchMethod( - Invocation.method( - #forEach, - [action], - ), - returnValueForMissingStub: null, - ); -} diff --git a/test/over_react/component/_deprecated/shared_error_boundary_tests.dart b/test/over_react/component/_deprecated/shared_error_boundary_tests.dart index cad66fe2b..dc4813990 100644 --- a/test/over_react/component/_deprecated/shared_error_boundary_tests.dart +++ b/test/over_react/component/_deprecated/shared_error_boundary_tests.dart @@ -371,7 +371,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); _setCallbackVarValues(); @@ -407,9 +407,9 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentDidCatch'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentDidCatch'), isTrue, reason: 'onComponentDidCatch should have been called'); - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); _setCallbackVarValues(); @@ -451,7 +451,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -485,7 +485,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentDidCatch'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentDidCatch'), isTrue, reason: 'onComponentDidCatch should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentDidCatch') .first['onComponentDidCatch']![0], @@ -495,7 +495,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil isA(), reason: 'error info should have been passed to onComponentDidCatch as a string'); - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentIsUnrecoverable') .first['onComponentIsUnrecoverable']![0], @@ -525,7 +525,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentDidCatch'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentDidCatch'), isTrue, reason: 'onComponentDidCatch should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentDidCatch') .first['onComponentDidCatch']![0], @@ -535,7 +535,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil isA(), reason: 'error info should have been passed to onComponentDidCatch as a string'); - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentIsUnrecoverable') .first['onComponentIsUnrecoverable']![0], @@ -574,7 +574,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -599,7 +599,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -644,7 +644,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -684,7 +684,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -709,7 +709,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -754,7 +754,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -789,7 +789,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -830,7 +830,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -865,7 +865,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -902,7 +902,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -937,7 +937,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory buil }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); diff --git a/test/over_react/component/error_boundary/shared_error_boundary_tests.dart b/test/over_react/component/error_boundary/shared_error_boundary_tests.dart index 1452e22df..5c89a610d 100644 --- a/test/over_react/component/error_boundary/shared_error_boundary_tests.dart +++ b/test/over_react/component/error_boundary/shared_error_boundary_tests.dart @@ -362,7 +362,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); _setCallbackVarValues(); @@ -398,9 +398,9 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentDidCatch'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentDidCatch'), isTrue, reason: 'onComponentDidCatch should have been called'); - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); _setCallbackVarValues(); @@ -442,7 +442,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -476,7 +476,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentDidCatch'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentDidCatch'), isTrue, reason: 'onComponentDidCatch should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentDidCatch') .first['onComponentDidCatch']![0], @@ -486,7 +486,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde isA(), reason: 'error info should have been passed to onComponentDidCatch as a string'); - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentIsUnrecoverable') .first['onComponentIsUnrecoverable']![0], @@ -516,7 +516,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentDidCatch'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentDidCatch'), isTrue, reason: 'onComponentDidCatch should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentDidCatch') .first['onComponentDidCatch']![0], @@ -526,7 +526,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde isA(), reason: 'error info should have been passed to onComponentDidCatch as a string'); - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(calls!.where((call) => call.keys.single == 'onComponentIsUnrecoverable') .first['onComponentIsUnrecoverable']![0], @@ -565,7 +565,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -590,7 +590,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -635,7 +635,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -675,7 +675,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -700,7 +700,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isTrue, reason: 'onComponentIsUnrecoverable should have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -745,7 +745,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -780,7 +780,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -821,7 +821,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -856,7 +856,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -893,7 +893,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); @@ -928,7 +928,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory builde }); test('the correct callbacks are called with the correct arguments', () { - expect(calls!.any()((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, + expect(calls!.any((call) => call.keys.single == 'onComponentIsUnrecoverable'), isFalse, reason: 'onComponentIsUnrecoverable should not have been called'); expect(errorSentToComponentDidCatchCallback, isA()); diff --git a/test/over_react/shared/map_proxy_tests.dart b/test/over_react/shared/map_proxy_tests.dart index df98da9a7..73ef73dcc 100644 --- a/test/over_react/shared/map_proxy_tests.dart +++ b/test/over_react/shared/map_proxy_tests.dart @@ -18,7 +18,6 @@ library over_react_tests.shared.map_proxy_tests; import 'package:mocktail/mocktail.dart'; import 'package:test/test.dart'; -import '../../mockito.mocks.dart'; void mapProxyTests(Map Function(Map proxiedMap) mapProxyFactory) { group('proxies the Map member:', () { @@ -176,3 +175,5 @@ void mapProxyTests(Map Function(Map proxiedMap) mapProxyFactory) { }); }); } + +class MockMap extends Mock implements Map {} diff --git a/test/vm_tests/builder/codegen_test.dart b/test/vm_tests/builder/codegen_test.dart index 65c3c25e1..68372a50d 100644 --- a/test/vm_tests/builder/codegen_test.dart +++ b/test/vm_tests/builder/codegen_test.dart @@ -17,6 +17,7 @@ library impl_generation_test; import 'package:analyzer/dart/analysis/utilities.dart'; import 'package:analyzer/dart/ast/ast.dart'; +import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; import 'package:mocktail/mocktail.dart'; import 'package:over_react/src/builder/parsing.dart'; @@ -24,13 +25,9 @@ import 'package:over_react/src/builder/codegen.dart'; import 'package:source_span/source_span.dart'; import 'package:test/test.dart'; -import '../../mockito.mocks.dart'; import './util.dart'; -import 'dart:core' show Object; main() { - setUpAll(() => registerFallbackValue(_FakeObject())); - group('ImplGenerator', () { ImplGenerator? implGenerator; @@ -137,35 +134,35 @@ main() { test('contains props or state descriptors for all fields', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' static const $descriptorType _\$prop__someField___\$$className = $descriptorType(_\$key__someField___\$$className);\n' - ' static const $descriptorType _\$prop__foo___\$$className = $descriptorType(_\$key__foo___\$$className);\n' - ' static const $descriptorType _\$prop__bar___\$$className = $descriptorType(_\$key__bar___\$$className);\n' - ' static const $descriptorType _\$prop__baz___\$$className = $descriptorType(_\$key__baz___\$$className);\n')); + ' static const $descriptorType _\$prop__foo___\$$className = $descriptorType(_\$key__foo___\$$className);\n' + ' static const $descriptorType _\$prop__bar___\$$className = $descriptorType(_\$key__bar___\$$className);\n' + ' static const $descriptorType _\$prop__baz___\$$className = $descriptorType(_\$key__baz___\$$className);\n')); }); test('contains string keys', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' static const String _\$key__someField___\$$className = \'$className.someField\';\n' - ' static const String _\$key__foo___\$$className = \'$className.foo\';\n' - ' static const String _\$key__bar___\$$className = \'$className.bar\';\n' - ' static const String _\$key__baz___\$$className = \'$className.baz\';\n')); + ' static const String _\$key__foo___\$$className = \'$className.foo\';\n' + ' static const String _\$key__bar___\$$className = \'$className.bar\';\n' + ' static const String _\$key__baz___\$$className = \'$className.baz\';\n')); }); test('contains list of descriptors', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' static const List<$descriptorType> ${ors.constantListName} = ' - '[_\$prop__someField___\$$className, ' - '_\$prop__foo___\$$className, ' - '_\$prop__bar___\$$className, ' - '_\$prop__baz___\$$className];\n')); + '[_\$prop__someField___\$$className, ' + '_\$prop__foo___\$$className, ' + '_\$prop__bar___\$$className, ' + '_\$prop__baz___\$$className];\n')); }); test('contains list of keys', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' static const List ${ors.keyListName} = ' - '[_\$key__someField___\$$className, ' - '_\$key__foo___\$$className, ' - '_\$key__bar___\$$className, ' - '_\$key__baz___\$$className];\n')); + '[_\$key__someField___\$$className, ' + '_\$key__foo___\$$className, ' + '_\$key__bar___\$$className, ' + '_\$key__baz___\$$className];\n')); }); group('with concrete implementations', () { @@ -190,10 +187,10 @@ main() { test('that carry over annotations', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @deprecated()\n' - ' String get someField => ')); + ' String get someField => ')); expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @deprecated()\n' - ' set someField(String value) => ')); + ' set someField(String value) => ')); }); test('but does not create implementations for non-fields', () { @@ -248,10 +245,10 @@ main() { test('that carry over annotations', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @deprecated()\n' - ' String get someField => ')); + ' String get someField => ')); expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @deprecated()\n' - ' set someField(String value) => ')); + ' set someField(String value) => ')); }); test('but does not create implementations for non-fields', () { @@ -314,12 +311,12 @@ main() { final baseName = ors.prefixedBaseName; expect(implGenerator!.outputContentsBuffer.toString(), contains( 'final \$${baseName}ComponentFactory = registerComponent(\n' - ' () => _\$${baseName}Component(),\n' - ' builderFactory: _\$$baseName,\n' - ' componentClass: ${baseName}Component,\n' - ' isWrapper: false,\n' - ' parentType: null,\n' - ');\n')); + ' () => _\$${baseName}Component(),\n' + ' builderFactory: _\$$baseName,\n' + ' componentClass: ${baseName}Component,\n' + ' isWrapper: false,\n' + ' parentType: null,\n' + ');\n')); }); } @@ -356,41 +353,41 @@ main() { test('with the correct class declaration', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( 'class _\$\$${ors.prefixedBaseName}Props${ors.typeParamSrc} ' - 'extends _\$${ors.propsClassName}${ors.typeParamSrcWithoutBounds} ' - 'with _\$${ors.propsClassName}AccessorsMixin${ors.typeParamSrcWithoutBounds} ' - 'implements ${ors.propsClassName}${ors.typeParamSrcWithoutBounds} {')); + 'extends _\$${ors.propsClassName}${ors.typeParamSrcWithoutBounds} ' + 'with _\$${ors.propsClassName}AccessorsMixin${ors.typeParamSrcWithoutBounds} ' + 'implements ${ors.propsClassName}${ors.typeParamSrcWithoutBounds} {')); }); test('with the correct constructor', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' _\$\$${ors.prefixedBaseName}Props(Map backingMap) : this._props = {} {\n' - ' this._props = backingMap ?? {};\n' - ' }')); + ' this._props = backingMap ?? {};\n' + ' }')); }); test('with props backing map getter', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' Map get props => _props;\n' - ' Map _props;')); + ' Map get props => _props;\n' + ' Map _props;')); }); test('overrides `\$isClassGenerated` to return `true`', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' bool get \$isClassGenerated => true;\n')); + ' bool get \$isClassGenerated => true;\n')); }); test('overrides `componentFactory` to return the correct component factory', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' ReactComponentFactoryProxy get componentFactory => super.componentFactory ?? \$${ors.prefixedBaseName}ComponentFactory;\n')); + ' ReactComponentFactoryProxy get componentFactory => super.componentFactory ?? \$${ors.prefixedBaseName}ComponentFactory;\n')); }); test('sets the default prop key namespace', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' String get propKeyNamespace => \'${ors.propsClassName}.\';\n')); + ' String get propKeyNamespace => \'${ors.propsClassName}.\';\n')); }); }); } @@ -428,29 +425,29 @@ main() { test('with the correct class declaration', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( 'class _\$\$${ors.prefixedBaseName}State${ors.typeParamSrc} ' - 'extends _\$${ors.stateClassName}${ors.typeParamSrcWithoutBounds} ' - 'with _\$${ors.stateClassName}AccessorsMixin${ors.typeParamSrcWithoutBounds} ' - 'implements ${ors.stateClassName}${ors.typeParamSrcWithoutBounds} {')); + 'extends _\$${ors.stateClassName}${ors.typeParamSrcWithoutBounds} ' + 'with _\$${ors.stateClassName}AccessorsMixin${ors.typeParamSrcWithoutBounds} ' + 'implements ${ors.stateClassName}${ors.typeParamSrcWithoutBounds} {')); }); test('with the correct constructor', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' _\$\$${ors.prefixedBaseName}State(Map backingMap) : this._state = {} {\n' - ' this._state = backingMap ?? {};\n' - ' }')); + ' this._state = backingMap ?? {};\n' + ' }')); }); test('with state backing map getter', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' Map get state => _state;\n' - ' Map _state;')); + ' Map get state => _state;\n' + ' Map _state;')); }); test('overrides `\$isClassGenerated` to return `true`', () { expect(implGenerator!.outputContentsBuffer.toString(), contains( ' @override\n' - ' bool get \$isClassGenerated => true;\n')); + ' bool get \$isClassGenerated => true;\n')); }); }); } @@ -475,9 +472,9 @@ main() { final className = ors.isProps(ors.annotation) ? ors.propsClassName : ors.stateClassName; final metaStructName = ors.isProps(ors.annotation) ? 'PropsMeta' : 'StateMeta'; expect(implGenerator!.outputContentsBuffer.toString(), contains( - 'class $className extends _\$$className with _\$${className}AccessorsMixin {\n' - ' static const $metaStructName meta = _\$metaFor$className;\n' - '}\n')); + 'class $className extends _\$$className with _\$${className}AccessorsMixin {\n' + ' static const $metaStructName meta = _\$metaFor$className;\n' + '}\n')); }); } testConsumableCompanionGeneration('for props classes', OverReactSrc.props(backwardsCompatible: false)); @@ -488,12 +485,12 @@ main() { group('and copies over static fields with Dart 2 only boilerplate', () { final fieldDeclarations = [ - 'static const String some_string_const = \'some_string_prop\';', - 'static final SomeMapView defaultProps = ', - 'new SomeMapView({})', - '..item1 = 1', - '..item2 = \'some_prop\';' - ]; + 'static const String some_string_const = \'some_string_prop\';', + 'static final SomeMapView defaultProps = ', + 'new SomeMapView({})', + '..item1 = 1', + '..item2 = \'some_prop\';' + ]; const uselessMetaField = 'static const String meta = \'some_string\';'; const uselessMetaMethod = 'static String get meta => \'some_string\';'; @@ -664,16 +661,16 @@ main() { group('and generates props config for function components constructed with', () { String generatedConfig(String propsName, String factoryName) { return 'final UiFactoryConfig<_\$\$$propsName> ' - '_\$${factoryName}Config = UiFactoryConfig(\n' - 'propsFactory: PropsFactory(\n' - 'map: (map) => _\$\$$propsName(map),\n' - 'jsMap: (map) => _\$\$$propsName\$JsMap(map),),\n' - 'displayName: \'$factoryName\');\n\n' - '@Deprecated(r\'Use the private variable, _\$${factoryName}Config, instead \'\n' - '\'and update the `over_react` lower bound to version 4.1.0. \'\n' - '\'For information on why this is deprecated, see https://github.com/Workiva/over_react/pull/650\')\n' - 'final UiFactoryConfig<_\$\$$propsName> ' - '\$${factoryName}Config = _\$${factoryName}Config;\n\n'; + '_\$${factoryName}Config = UiFactoryConfig(\n' + 'propsFactory: PropsFactory(\n' + 'map: (map) => _\$\$$propsName(map),\n' + 'jsMap: (map) => _\$\$$propsName\$JsMap(map),),\n' + 'displayName: \'$factoryName\');\n\n' + '@Deprecated(r\'Use the private variable, _\$${factoryName}Config, instead \'\n' + '\'and update the `over_react` lower bound to version 4.1.0. \'\n' + '\'For information on why this is deprecated, see https://github.com/Workiva/over_react/pull/650\')\n' + 'final UiFactoryConfig<_\$\$$propsName> ' + '\$${factoryName}Config = _\$${factoryName}Config;\n\n'; } String generatedPropsMapsForConfig(String propsName) { @@ -1044,7 +1041,7 @@ main() { const expectedLateAndAnnotationErrorMessage = 'Props declared using `late` are already considered required,' ' and cannot also have required prop annotations: @requiredProp/@nullableProp/@Accessor(isRequired: true).' - '\nPlease remove these annotations.'; + '\nPlease remove these annotations.'; test('@Accessor(isRequired: true) @requiredProp', () { var body = '''@Accessor(isRequired: true) @@ -1120,5 +1117,4 @@ main() { }); } - -class _FakeObject extends Fake implements Object {} +class MockLogger extends Mock implements Logger{} diff --git a/test/vm_tests/builder/declaration_parsing_test.dart b/test/vm_tests/builder/declaration_parsing_test.dart index 89b0993c1..4cd93e9ac 100644 --- a/test/vm_tests/builder/declaration_parsing_test.dart +++ b/test/vm_tests/builder/declaration_parsing_test.dart @@ -31,14 +31,10 @@ import 'package:over_react/src/component_declaration/annotations.dart' as annota import 'package:source_span/source_span.dart'; import 'package:test/test.dart'; -import '../../mockito.mocks.dart'; import './util.dart'; import 'parsing/parsing_helpers.dart'; -import 'dart:core' show Object; main() { - setUpAll(() => registerFallbackValue(_FakeObject())); - group('ComponentDeclarations', () { group('mightContainDeclarations()', () { group('returns true when the source contains an annotation', () { @@ -473,15 +469,15 @@ main() { } } - test('with backwards compatible boilerplate', () { - testStateMixins(OverReactSrc.stateMixin(numMixins: 3).source, - ['FooStateMixin1', 'FooStateMixin2', 'FooStateMixin3']); - }); + test('with backwards compatible boilerplate', () { + testStateMixins(OverReactSrc.stateMixin(numMixins: 3).source, + ['FooStateMixin1', 'FooStateMixin2', 'FooStateMixin3']); + }); - test('with Dart 2 only boilerplate', () { - testStateMixins(OverReactSrc.stateMixin(backwardsCompatible: false, numMixins: 3).source, - ['_\$FooStateMixin1', '_\$FooStateMixin2', '_\$FooStateMixin3']); - }); + test('with Dart 2 only boilerplate', () { + testStateMixins(OverReactSrc.stateMixin(backwardsCompatible: false, numMixins: 3).source, + ['_\$FooStateMixin1', '_\$FooStateMixin2', '_\$FooStateMixin3']); + }); }); group('abstract props class with builder-compatible dual-class setup', () { @@ -1040,9 +1036,9 @@ main() { test('that are the correct version', () { final versionForFirstMixin = - resolveVersion(componentDeclarations.firstWhereNameEquals('FirstFoo')!.members); + resolveVersion(componentDeclarations.firstWhereNameEquals('FirstFoo')!.members); final versionForSecondMixin = - resolveVersion(componentDeclarations.firstWhereNameEquals('SecondFoo')!.members); + resolveVersion(componentDeclarations.firstWhereNameEquals('SecondFoo')!.members); expect(versionForFirstMixin.version, Version.v4_mixinBased); expect(versionForSecondMixin.version, Version.v4_mixinBased); @@ -1073,9 +1069,9 @@ main() { test('with names that match expectations', () { final propsComponentDeclaration = - componentDeclarations.firstWhereNameEquals('PropsFoo'); + componentDeclarations.firstWhereNameEquals('PropsFoo'); final stateComponentDeclaration = - componentDeclarations.firstWhereNameEquals('StateFoo'); + componentDeclarations.firstWhereNameEquals('StateFoo'); final secondComponent = componentDeclarations.firstWhereNameEquals('SecondFoo'); final thirdComponent = componentDeclarations.firstWhereNameEquals('ThirdFoo'); @@ -1095,9 +1091,9 @@ main() { test('that are the correct version', () { final versionForFirstMixin = - resolveVersion(componentDeclarations.firstWhereNameEquals('SecondFoo')!.members); + resolveVersion(componentDeclarations.firstWhereNameEquals('SecondFoo')!.members); final versionForSecondMixin = - resolveVersion(componentDeclarations.firstWhereNameEquals('ThirdFoo')!.members); + resolveVersion(componentDeclarations.firstWhereNameEquals('ThirdFoo')!.members); final abstractProps = resolveVersion( declarations!.firstWhereType().members); final abstractState = resolveVersion( @@ -2190,7 +2186,7 @@ main() { } '''); verify(() => logger!.severe(contains('Static PropsMeta field in accessor class must be initialized to:' - '`_\$metaForAbstractFooProps`'))); + '`_\$metaForAbstractFooProps`'))); }); test('is private and initialized incorrectly', () { @@ -2201,7 +2197,7 @@ main() { } '''); verify(() => logger!.severe(contains('Static PropsMeta field in accessor class must be initialized to:' - '`_\$metaFor_AbstractFooProps`'))); + '`_\$metaFor_AbstractFooProps`'))); }); }); @@ -2468,9 +2464,9 @@ main() { group('a static `meta` field is declared in ', () { void verifyWarningLog(String publicClassName) { verify(() => logger!.warning(contains( - 'Static class member `meta` is declared in _\$$publicClassName. ' - '`meta` is a field declared by the over_react builder, and therefore this ' - 'class member will be unused and should be removed or renamed.' + 'Static class member `meta` is declared in _\$$publicClassName. ' + '`meta` is a field declared by the over_react builder, and therefore this ' + 'class member will be unused and should be removed or renamed.' ))); } @@ -2548,7 +2544,7 @@ main() { .havingLevel(Level.SEVERE) .havingMessage(contains('Error reading component annotation')) .havingError(isA() - .havingToStringValue(contains('`subtypeOf` must be an identifier'))), + .havingToStringValue(contains('`subtypeOf` must be an identifier'))), ])); } @@ -2589,4 +2585,4 @@ extension on TypeMatcher { TypeMatcher havingError(dynamic matcher) => having((r) => r.error, 'error', matcher); } -class _FakeObject extends Fake implements Object {} +class MockLogger extends Mock implements Logger{} diff --git a/test/vm_tests/builder/parsing/error_collection_test.dart b/test/vm_tests/builder/parsing/error_collection_test.dart index b1c897136..a9a2ec016 100644 --- a/test/vm_tests/builder/parsing/error_collection_test.dart +++ b/test/vm_tests/builder/parsing/error_collection_test.dart @@ -15,12 +15,12 @@ @TestOn('vm') import 'package:analyzer/dart/analysis/utilities.dart'; import 'package:analyzer/dart/ast/ast.dart'; +import 'package:logging/logging.dart'; import 'package:mocktail/mocktail.dart'; import 'package:over_react/src/builder/parsing.dart'; import 'package:source_span/source_span.dart'; import 'package:test/test.dart'; -import '../../../mockito.mocks.dart'; main() { group('error collection -', () { @@ -307,3 +307,4 @@ main() { }); }); } +class MockLogger extends Mock implements Logger {} \ No newline at end of file