| 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:test/src/backend/declarer.dart'; | |
| 8 import 'package:test/src/backend/group.dart'; | 7 import 'package:test/src/backend/group.dart'; |
| 9 import 'package:test/src/backend/invoker.dart'; | 8 import 'package:test/src/backend/invoker.dart'; |
| 10 import 'package:test/src/backend/suite.dart'; | 9 import 'package:test/src/backend/suite.dart'; |
| 11 import 'package:test/src/backend/test.dart'; | 10 import 'package:test/src/backend/test.dart'; |
| 12 import 'package:test/src/frontend/timeout.dart'; | 11 import 'package:test/src/frontend/timeout.dart'; |
| 13 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
| 14 | 13 |
| 15 import '../utils.dart'; | 14 import '../utils.dart'; |
| 16 | 15 |
| 17 Suite _suite; | 16 Suite _suite; |
| 18 | 17 |
| 19 void main() { | 18 void main() { |
| 20 setUp(() { | 19 setUp(() { |
| 21 _suite = new Suite([]); | 20 _suite = new Suite(new Group.root([])); |
| 22 }); | 21 }); |
| 23 | 22 |
| 24 group(".test()", () { | 23 group(".test()", () { |
| 25 test("declares a test with a description and body", () async { | 24 test("declares a test with a description and body", () async { |
| 26 var bodyRun = false; | 25 var bodyRun = false; |
| 27 var tests = declare(() { | 26 var tests = declare(() { |
| 28 test("description", () { | 27 test("description", () { |
| 29 bodyRun = true; | 28 bodyRun = true; |
| 30 }); | 29 }); |
| 31 }); | 30 }); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 /// doesn't throw any invisible exceptions. | 539 /// doesn't throw any invisible exceptions. |
| 541 Future _runTest(Test test, {bool shouldFail: false}) { | 540 Future _runTest(Test test, {bool shouldFail: false}) { |
| 542 var liveTest = test.load(_suite); | 541 var liveTest = test.load(_suite); |
| 543 | 542 |
| 544 liveTest.onError.listen(shouldFail | 543 liveTest.onError.listen(shouldFail |
| 545 ? expectAsync((_) {}) | 544 ? expectAsync((_) {}) |
| 546 : (error) => registerException(error.error, error.stackTrace)); | 545 : (error) => registerException(error.error, error.stackTrace)); |
| 547 | 546 |
| 548 return liveTest.run(); | 547 return liveTest.run(); |
| 549 } | 548 } |
| OLD | NEW |