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

Side by Side Diff: test/invoker_test.dart

Issue 941123002: Get all tests running via the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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 | « lib/src/isolate_wrapper.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 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:fake_async/fake_async.dart'; 7 import 'package:fake_async/fake_async.dart';
8 import 'package:unittest/src/invoker.dart'; 8 import 'package:unittest/src/invoker.dart';
9 import 'package:unittest/src/state.dart'; 9 import 'package:unittest/src/state.dart';
10 import 'package:unittest/src/suite.dart'; 10 import 'package:unittest/src/suite.dart';
11 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
12 12
13 import 'utils.dart'; 13 import 'utils.dart';
14 14
15 void main() { 15 void main() {
16 var suite; 16 var suite;
17 setUp(() { 17 setUp(() {
18 lastState = null; 18 lastState = null;
19 suite = new Suite("suite", []); 19 suite = new Suite("suite", []);
20 }); 20 });
21 21
22 group("Invoker.current", () { 22 group("Invoker.current", () {
23 var invoker = Invoker.current;
23 test("returns null outside of a test body", () { 24 test("returns null outside of a test body", () {
24 expect(Invoker.current, isNull); 25 expect(invoker, isNull);
25 }); 26 });
26 27
27 test("returns the current invoker in a test body", () { 28 test("returns the current invoker in a test body", () {
28 var invoker; 29 var invoker;
29 var liveTest = new LocalTest("test", () { 30 var liveTest = new LocalTest("test", () {
30 invoker = Invoker.current; 31 invoker = Invoker.current;
31 }).load(suite); 32 }).load(suite);
32 liveTest.onError.listen(expectAsync((_) {}, count: 0)); 33 liveTest.onError.listen(expectAsync((_) {}, count: 0));
33 34
34 return liveTest.run().then((_) { 35 return liveTest.run().then((_) {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 expectErrors(liveTest, [(error) { 486 expectErrors(liveTest, [(error) {
486 expect(lastState.status, equals(Status.complete)); 487 expect(lastState.status, equals(Status.complete));
487 expect(error, new isInstanceOf<TimeoutException>()); 488 expect(error, new isInstanceOf<TimeoutException>());
488 }]); 489 }]);
489 490
490 liveTest.run(); 491 liveTest.run();
491 async.elapse(new Duration(seconds: 30)); 492 async.elapse(new Duration(seconds: 30));
492 }); 493 });
493 }); 494 });
494 } 495 }
OLDNEW
« no previous file with comments | « lib/src/isolate_wrapper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698