Open
Description
import 'package:mockito/annotations.dart';
class Foo {
Future<Id> bar() async => Id(0);
}
extension type Id(int id) {}
@GenerateNiceMocks([MockSpec<Foo>()])
class Test {}
Will generate
class MockFoo extends _i1.Mock implements _i2.Foo {
@override
_i3.Future<_i2.Id> bar() =>
(super.noSuchMethod(
Invocation.method(#bar, []),
returnValue: _i3.Future<_i2.Id>.value(0),
returnValueForMissingStub: _i3.Future<_i2.Id>.value(0),
)
as _i3.Future<_i2.Id>);
}
and error: The argument type 'int' can't be assigned to the parameter type 'FutureOr<Id>?'. (argument_type_not_assignable at [mock] test/mock.mocks.dart:34)
Metadata
Metadata
Assignees
Labels
No labels