Closed pongloongyeat closed 10 months ago
To add, seems like doing this works but this would effectively make my setUp
s useless and I'd have to write this at the start of a test each time.
group('SomeBloc', () {
+ final repository1 = MockRepository1();
+ final repository2 = MockRepository2();
+ final bloc = SomeBloc(0, repository1: repository1, repository2: repository2);
test('', () {
when(repository1.call).thenAnswer((_) async {});
when(repository2.call).thenAnswer((_) async {});
testBloc(
build: () => bloc,
act: (bloc) => bloc.add(1),
expect: () => [0],
);
});
});
Closing as issue is not related to mocktail
but rather the incorrect use of bloc_test
(should've used blocTest
instead of testBloc
).
Describe the bug Not sure if this is the underlying issue but it seems like calling two stubbed methods one after the other causes the example below to throw
type 'Null' is not a subtype of type 'Future<void>'
.To Reproduce
Expected behavior It shouldn't throw
Additional context
mocktail: 1.0.0