Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1508)

Unified Diff: test/runner/engine_test.dart

Issue 1093633004: Add test- and group-level support for skipping tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/runner/compact_reporter_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/engine_test.dart
diff --git a/test/runner/engine_test.dart b/test/runner/engine_test.dart
index 78baa2e1fbaf8a9ab3de682254d9af0eda5adff5..6fc9a9ad1181f3bf5c34064e110a7354400ab89e 100644
--- a/test/runner/engine_test.dart
+++ b/test/runner/engine_test.dart
@@ -84,4 +84,36 @@ void main() {
expect(engine.run(), completes);
expect(() => engine.run(), throwsStateError);
});
+
+ group("for a skipped test", () {
+ test("doesn't run the test's body", () {
+ var bodyRun = false;
+ declarer.test("test", () => bodyRun = true, skip: true);
+
+ var engine = new Engine([new Suite(declarer.tests)]);
+ return engine.run().then((_) {
+ expect(bodyRun, isFalse);
+ });
+ });
+
+ test("exposes a LiveTest that emits the correct states", () {
+ declarer.test("test", () {}, skip: true);
+
+ var engine = new Engine([new Suite(declarer.tests)]);
+ var liveTest = engine.liveTests.single;
+ expect(liveTest.test, equals(declarer.tests.single));
+
+ var first = true;
+ liveTest.onStateChange.listen(expectAsync((state) {
+ expect(state, equals(first
+ ? const State(Status.running, Result.success)
+ : const State(Status.complete, Result.success)));
+ first = false;
+ }, count: 2));
+
+ expect(liveTest.onComplete, completes);
+
+ return engine.run();
+ });
+ });
}
« no previous file with comments | « test/runner/compact_reporter_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698