Closed inteist closed 1 week ago
Thanks for the report. Can you send us a minimal reproduction case? We'd need to see the @GenerateNiceMocks
call, and the definition of the classes being mocked. Thanks!
Thanks for such a prompt response. I am using a stacked
package (framework) and this is the stacked generated code:
@GenerateMocks([], customMocks: [
MockSpec<NavigationService>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<BottomSheetService>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<DialogService>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<PackageInfoService>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<RemoteConfigService>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<DeviceInfoService>(onMissingStub: OnMissingStub.returnDefault),
...
I noticed it uses @GenerateMocks
instead of NiceMocks
when i replaced it with NiceMocks - the error is gone but my mock file is not generated (might be a separate issue, I have ravaged my project trying to solve this)
Does that provide any insight and can you possibly direct me towards solution to my issue?
Thanks!
Sorry, my previous reply is crap. It did not generate the issue, because the call was wrong.
@GenerateNiceMocks([
MockSpec<NavigationService>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<BottomSheetService>(onMissingStub: OnMissingStub.returnDefault),
...
produces the same error.
after 6 hours of digging around and finally resorting to Git backtracking, I found the issue:
I had this in one of the dialogs:
{String confirmationText = "Are you sure you want to continue?'"}) async {
note the '
right before last "
what a trip because of this... 🤦
and I am not sure who's at "fault" - me, stacked or mockito...
Thanks for the repro! Mockito should be able to handle this; the bug is either in mockito or code_builder, but most likely mockito.
Ah yeah, pretty simple bug in mockito. Fix is in progress.
Hi, sorry if this is the wrong place but I am not sure what or where the issue is.
I am getting the following error while running build generator
It has suddenly appeared and I am at loss... I have been trying to figure this out for several hours with no valid leads as to what the issue is or what the source is.
Thank you for your help!