OLD | NEW |
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/backend/invoker.dart'; | 8 import 'package:unittest/src/backend/invoker.dart'; |
9 import 'package:unittest/src/backend/state.dart'; | 9 import 'package:unittest/src/backend/state.dart'; |
10 import 'package:unittest/src/backend/suite.dart'; | 10 import 'package:unittest/src/backend/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([]); |
20 }); | 20 }); |
21 | 21 |
22 group("Invoker.current", () { | 22 group("Invoker.current", () { |
23 var invoker = Invoker.current; | 23 var invoker = Invoker.current; |
24 test("returns null outside of a test body", () { | 24 test("returns null outside of a test body", () { |
25 expect(invoker, isNull); | 25 expect(invoker, isNull); |
26 }); | 26 }); |
27 | 27 |
28 test("returns the current invoker in a test body", () { | 28 test("returns the current invoker in a test body", () { |
29 var invoker; | 29 var invoker; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 expectErrors(liveTest, [(error) { | 486 expectErrors(liveTest, [(error) { |
487 expect(lastState.status, equals(Status.complete)); | 487 expect(lastState.status, equals(Status.complete)); |
488 expect(error, new isInstanceOf<TimeoutException>()); | 488 expect(error, new isInstanceOf<TimeoutException>()); |
489 }]); | 489 }]); |
490 | 490 |
491 liveTest.run(); | 491 liveTest.run(); |
492 async.elapse(new Duration(seconds: 30)); | 492 async.elapse(new Duration(seconds: 30)); |
493 }); | 493 }); |
494 }); | 494 }); |
495 } | 495 } |
OLD | NEW |