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 @TestOn("vm") | 5 @TestOn("vm") |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 import 'package:test/src/backend/state.dart'; | 10 import 'package:test/src/backend/state.dart'; |
(...skipping 15 matching lines...) Expand all Loading... |
26 import 'package:test/test.dart'; | 26 import 'package:test/test.dart'; |
27 | 27 |
28 void main() { | 28 void main() { |
29 test("success", () {}); | 29 test("success", () {}); |
30 test("failure", () => throw new TestFailure('oh no')); | 30 test("failure", () => throw new TestFailure('oh no')); |
31 test("error", () => throw 'oh no'); | 31 test("error", () => throw 'oh no'); |
32 } | 32 } |
33 """; | 33 """; |
34 | 34 |
35 void main() { | 35 void main() { |
36 setUp(() { | 36 setUp(() async { |
37 _sandbox = createTempDir(); | 37 _sandbox = createTempDir(); |
38 _loader = new Loader( | 38 _loader = new Loader( |
39 new Configuration(packageRoot: p.join(packageDir, 'packages')), | 39 new Configuration(), |
40 root: _sandbox); | 40 root: _sandbox); |
41 }); | 41 }); |
42 | 42 |
43 tearDown(() { | 43 tearDown(() { |
44 new Directory(_sandbox).deleteSync(recursive: true); | 44 new Directory(_sandbox).deleteSync(recursive: true); |
45 return _loader.close(); | 45 return _loader.close(); |
46 }); | 46 }); |
47 | 47 |
48 group(".loadFile()", () { | 48 group(".loadFile()", () { |
49 var suite; | 49 var suite; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 var liveTest = await loadSuite.group.entries.single.load(loadSuite); | 155 var liveTest = await loadSuite.group.entries.single.load(loadSuite); |
156 expect(liveTest.onMessage.first.then((message) => message.text), | 156 expect(liveTest.onMessage.first.then((message) => message.text), |
157 completion(equals("print within test"))); | 157 completion(equals("print within test"))); |
158 await liveTest.run(); | 158 await liveTest.run(); |
159 expectTestPassed(liveTest); | 159 expectTestPassed(liveTest); |
160 }); | 160 }); |
161 | 161 |
162 // TODO: Test load suites. Don't forget to test that prints in loaded files | 162 // TODO: Test load suites. Don't forget to test that prints in loaded files |
163 // are piped through the suite. Also for browser tests! | 163 // are piped through the suite. Also for browser tests! |
164 } | 164 } |
OLD | NEW |