matcher
matcher copied to clipboard
isInstanceOf should be a method
@kevmoo @natebosch
Based on our meeting today, Flutter is hiding TypeMatcher and isInstanceOf from test in all our tests (and in the flutter_test package that we export to our users), and instead just exporting a function called isInstanceOf. This is ugly and we would prefer if we could just have an isInstanceOf method so that we didn't need to have these hacks.
When we're ready to roll a major release of matcher + test, we'll make this change!
#110 didn't solve this. It used a different name that won't allow us to unfork.
Will leave open until we can remove isInstanceOf with a breaking change version bump.
Discussed offline - flutter_test will keep it's own isInstanceOf unless they decide to do a breaking change, or forever, which can be handled independently from anything test. We will not keep isInstanceOf in matcher or test once we have other compelling reasons for a breaking version bump.
I'm not sure what the current intention is, but currently the documentation for isInstanceOf says:
DEPRECATED Use TypeMatcher instead.
but also:
Annotations @Deprecated('Use
isA<MyType>()instead.')
which seems inconsistent.
It's also confusing to recommend using TypeMatcher because Flutter has its own copy of the package:matcher docs, but in a Flutter context, package:matcher's TypeMatcher is hidden and TypeMatcher is something different.
FYI: Flutter TypeMatcher is now marked as deprecated.
We shipped isA<T>, which can be pointed to by Flutters isInstanceOf function.
Can we close this out?