mardi 1 septembre 2020

Dart tests are executed after normal code

I think this is poorly documented (if not a bug).

Dart first completes the code in main(), then the tests in functions test().

This code explains:

import 'package:test/test.dart';
void main() {
  test('',() {print('1');});
  print('2');
  test('',() {print('3');});
}

Output: 213

Aucun commentaire:

Enregistrer un commentaire