-
Notifications
You must be signed in to change notification settings - Fork 222
Description
There's some functionality in Dart-Code that tries to handle this, but it's a rather clunky and I think could be better dealt with here. (I'm not certain it's a common issue, but it did come up for Dart-Code at least once).
Consider a user duplicated a test, but forgot to update the name:
main() {
group('foo', () {
test('bar', () {});
test('bar', () {});
});
Since IDEs can only run tests by name, it can be confusing to click Run next to one test and find yourself debugging code that originated from the other.
Unless there's a good reason to support multiple tests with the same name, it would be nice if the test package could warn when this happens (or even just refuse to run). If it's opt-in with a flag, that would be fine too (the IDE could pass it in the case where it expects exactly one test to run - eg. "Run" is clicked on a test, and not a group).
Another possibility could be to detect this before running with a lint or something (although dynamic test names might complicate that a little)? @pq