test icon indicating copy to clipboard operation
test copied to clipboard

Invalid retry command if test fails to load

Open liamappelbe opened this issue 7 months ago • 1 comments

The test failure log includes a handy command to quickly rerun the failing test. But if the test failed because there's a compile error in the test, that message isn't so useful:

To run this test again: dart test test/other_test.dart -p vm --plain-name 'loading test/other_test.dart'

'loading test/other_test.dart' isn't a real test name, so if you fix the compile error and try to run the command it gives you, no tests are run:

> dart test test/other_test.dart -p vm --plain-name 'loading test/other_test.dart'
Building package executable... 
Built test:test.
No tests ran.                                                                                                  
No tests match "loading test/other_test.dart".

Ideally, the --plain-name part would just be omitted from that message, if the test failed to compile:

To run this test again: dart test test/other_test.dart -p vm

liamappelbe avatar Jul 20 '25 23:07 liamappelbe