Repository navigation
test(auth,performance): remove unused testExceptionHandling helpers - #18795
Conversation
The `testExceptionHandling` helpers in the firebase_auth and
firebase_performance platform interface tests have no callers. They also
contain an assertion that doesn't do what it appears to:
await expectLater(
() async => testMethod(),
anyOf([
completes,
if (type == 'PLATFORM' || type == 'EXCEPTION')
throwsA(isA<FirebaseException>()),
]),
);
`completes` only matches a `Future`, and the value here is a closure, so
that branch can never match. When `type` is `'PLATFORM'` or `'EXCEPTION'`
the `anyOf` behaves like `throwsA(...)` alone, and for any other `type` the
assertion always fails. In addition, `anyOf` can't combine asynchronous
matchers: it treats the pending result from `throwsA` as a match, and
`expectLater` doesn't wait for the real result.
An upcoming change to `package:matcher` makes `anyOf` and `isNot` throw an
`ArgumentError` when they are used with asynchronous matchers like these,
which would break these helpers if they were ever called again:
dart-lang/test#2792
Remove the helpers and the imports they used.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
@kevmoo - do you know who can help land this? |
The
testExceptionHandlinghelpers in the firebase_auth andfirebase_performance platform interface tests have no callers. They also
contain an assertion that doesn't do what it appears to:
completesonly matches aFuture, and the value here is a closure, sothat branch can never match. When
typeis'PLATFORM'or'EXCEPTION'the
anyOfbehaves likethrowsA(...)alone, and for any othertypetheassertion always fails. In addition,
anyOfcan't combine asynchronousmatchers: it treats the pending result from
throwsAas a match, andexpectLaterdoesn't wait for the real result.An upcoming change to
package:matchermakesanyOfandisNotthrow anArgumentErrorwhen they are used with asynchronous matchers like these,which would break these helpers if they were ever called again:
dart-lang/test#2792
Remove the helpers and the imports they used.