-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing failure with nested mocks #204
Comments
This was the other bug I thought I had, but can't seem to repro now:
Where call counts would get double-counted when using nested mocks in the verify() call. |
Hmm let me know if you find a way to reproduce it and I’ll check it out 👀 |
I suspect I have the curse of knowledge now and just know to avoid these things. :) Thanks! |
I had a test succeed when it shouldn't have, I think due to this issue. To reproduce: code (abbreviated for clarity): final deleteReleaseQuery = // the query;
final deleteReleaseResponse = await bigqueryClient.query(deleteReleaseQuery);
final deletePatchesQuery = '''
lkajsdfjasdkfjklasdfjklsdajfklasdjklasdfjklasdjf''';
final deletePatchesResponse =
await bigqueryClient.query(deletePatchesQuery); test: when(() => bigqueryClient.projectId).thenReturn('test-project-id');
verifyInOrder([
() => bigqueryClient.query('''
DELETE `${bigqueryClient.projectId}.command_metadata.release`
WHERE id = ${release.id};'''),
() => bigqueryClient.query(
'''
DELETE `${bigqueryClient.projectId}.command_metadata.patch`
WHERE id in (11);''',
),
]); This test succeeded because I was referencing the mocked |
Thanks @bryanoltman! |
Also seems related to #179 |
I meant to file this a few weeks ago, sorry.
That's a better error than I remember (I remember it being silent?) But it's still pretty confusing. Feel free to close.
The text was updated successfully, but these errors were encountered: