test icon indicating copy to clipboard operation
test copied to clipboard

Inconsistent output `dart test -r expanded test/`

Open jonasfj opened this issue 1 year ago • 0 comments

This gets very confusing when running a larger test suite.

$ dart test -r expanded test/
00:00 +0: loading test/b_test.dart
00:00 +0: test/a_test.dart: calculate A
00:00 +1: test/b_test.dart: calculate B
00:00 +2: All tests passed!

$ dart test -r expanded test/
00:00 +0: loading test/b_test.dart
00:00 +0: test/a_test.dart: calculate A
00:00 +1: test/b_test.dart: calculate B
00:00 +2: All tests passed!

$ dart test -r expanded test/
00:00 +0: loading test/b_test.dart
00:00 +0: test/b_test.dart: calculate B
00:00 +1: test/b_test.dart: calculate B
00:00 +2: All tests passed!

$ dart test -r expanded test/
00:00 +0: loading test/b_test.dart
00:00 +0: test/a_test.dart: calculate A
00:00 +1: test/a_test.dart: calculate A
00:00 +2: All tests passed!

I have files:

import 'package:test/test.dart';

void main() {
  test('calculate A', () {
    // print('A');
  });
}

and

import 'package:test/test.dart';

void main() {
  test('calculate B', () {
    // print('B');
  });
}

If I make the tests print something, then this is less likely to happen, but I'm not sure it won't.

jonasfj avatar Mar 05 '25 23:03 jonasfj