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:test/src/backend/group.dart'; |
8 import 'package:test/src/backend/invoker.dart'; | 9 import 'package:test/src/backend/invoker.dart'; |
9 import 'package:test/src/backend/metadata.dart'; | 10 import 'package:test/src/backend/metadata.dart'; |
10 import 'package:test/src/backend/state.dart'; | 11 import 'package:test/src/backend/state.dart'; |
11 import 'package:test/src/backend/suite.dart'; | 12 import 'package:test/src/backend/suite.dart'; |
12 import 'package:test/test.dart'; | 13 import 'package:test/test.dart'; |
13 | 14 |
14 import '../utils.dart'; | 15 import '../utils.dart'; |
15 | 16 |
16 void main() { | 17 void main() { |
17 var suite; | 18 var suite; |
18 setUp(() { | 19 setUp(() { |
19 lastState = null; | 20 lastState = null; |
20 suite = new Suite([]); | 21 suite = new Suite(new Group.root([])); |
21 }); | 22 }); |
22 | 23 |
23 group("Invoker.current", () { | 24 group("Invoker.current", () { |
24 var invoker = Invoker.current; | 25 var invoker = Invoker.current; |
25 test("returns null outside of a test body", () { | 26 test("returns null outside of a test body", () { |
26 expect(invoker, isNull); | 27 expect(invoker, isNull); |
27 }); | 28 }); |
28 | 29 |
29 test("returns the current invoker in a test body", () async { | 30 test("returns the current invoker in a test body", () async { |
30 var invoker; | 31 var invoker; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 expect(liveTest.state.status, equals(Status.complete)); | 523 expect(liveTest.state.status, equals(Status.complete)); |
523 expect(isComplete, isFalse); | 524 expect(isComplete, isFalse); |
524 }); | 525 }); |
525 }); | 526 }); |
526 } | 527 } |
527 | 528 |
528 LocalTest _localTest(body(), {Metadata metadata}) { | 529 LocalTest _localTest(body(), {Metadata metadata}) { |
529 if (metadata == null) metadata = new Metadata(); | 530 if (metadata == null) metadata = new Metadata(); |
530 return new LocalTest("test", metadata, body); | 531 return new LocalTest("test", metadata, body); |
531 } | 532 } |
OLD | NEW |