Reputation: 12483
I had some existing mocks with mockito. I changed the names of some classes that had been mocked and now mockito doesn't generate mocks for them anymore.
An example is:
import 'package:mockito/annotations.dart';
import 'package:vepo/src/presentation/pages/manage_vegan_items/page/helpers/manage_vegan_items_page_vm.dart';
@GenerateMocks([ManageVgnItmsPageVm])
void main() {}
It is imported without error. After running flutter pub run build_runner build
, no mocks have been generated for the newly named classes. The app runs fine. Does anyone know what might have caused mockito not to generate the mock files?
Upvotes: 5
Views: 2564
Reputation: 12483
It worked when I moved the mock in the question to the test/ directory
Upvotes: 2