Index: pkg/scheduled_test/test/metatest.dart |
diff --git a/pkg/scheduled_test/test/metatest.dart b/pkg/scheduled_test/test/metatest.dart |
index 0771ff41a42dee7e2fac9594c3129755760c77fd..71ad421fd9165c9adb29c5d598e2b37f84633103 100644 |
--- a/pkg/scheduled_test/test/metatest.dart |
+++ b/pkg/scheduled_test/test/metatest.dart |
@@ -15,6 +15,7 @@ import 'dart:isolate'; |
import 'package:pathos/path.dart' as path; |
import 'package:unittest/unittest.dart'; |
+import 'package:scheduled_test/scheduled_test.dart' as scheduled_test; |
import 'utils.dart'; |
@@ -71,6 +72,14 @@ void expectTestsFail(String description, void body()) { |
}); |
} |
+/// Runs [setUpFn] before every metatest. Note that [setUpFn] will be |
+/// overwritten if the test itself calls [setUp]. |
+void metaSetUp(void setUpFn()) { |
+ _inChildIsolate.then((inIsolate) { |
+ if (inIsolate) scheduled_test.setUp(setUpFn); |
+ }); |
+} |
+ |
/// Sets up a test with the given [description] and [body]. After the test runs, |
/// calls [validate] with the result map. |
void _setUpTest(String description, void body(), void validate(Map)) { |