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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « test/runner/compact_reporter_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:test/src/backend/declarer.dart'; 5 import 'package:test/src/backend/declarer.dart';
6 import 'package:test/src/backend/state.dart'; 6 import 'package:test/src/backend/state.dart';
7 import 'package:test/src/backend/suite.dart'; 7 import 'package:test/src/backend/suite.dart';
8 import 'package:test/src/runner/engine.dart'; 8 import 'package:test/src/runner/engine.dart';
9 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 var engine = new Engine([new Suite(declarer.tests)]); 78 var engine = new Engine([new Suite(declarer.tests)]);
79 expect(engine.run(), completion(isFalse)); 79 expect(engine.run(), completion(isFalse));
80 }); 80 });
81 81
82 test(".run() may not be called more than once", () { 82 test(".run() may not be called more than once", () {
83 var engine = new Engine([]); 83 var engine = new Engine([]);
84 expect(engine.run(), completes); 84 expect(engine.run(), completes);
85 expect(() => engine.run(), throwsStateError); 85 expect(() => engine.run(), throwsStateError);
86 }); 86 });
87
88 group("for a skipped test", () {
89 test("doesn't run the test's body", () {
90 var bodyRun = false;
91 declarer.test("test", () => bodyRun = true, skip: true);
92
93 var engine = new Engine([new Suite(declarer.tests)]);
94 return engine.run().then((_) {
95 expect(bodyRun, isFalse);
96 });
97 });
98
99 test("exposes a LiveTest that emits the correct states", () {
100 declarer.test("test", () {}, skip: true);
101
102 var engine = new Engine([new Suite(declarer.tests)]);
103 var liveTest = engine.liveTests.single;
104 expect(liveTest.test, equals(declarer.tests.single));
105
106 var first = true;
107 liveTest.onStateChange.listen(expectAsync((state) {
108 expect(state, equals(first
109 ? const State(Status.running, Result.success)
110 : const State(Status.complete, Result.success)));
111 first = false;
112 }, count: 2));
113
114 expect(liveTest.onComplete, completes);
115
116 return engine.run();
117 });
118 });
87 } 119 }
OLDNEW
« 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