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