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 135 matching lines...) Loading... |
146 void main() { | 146 void main() { |
147 print('print within test'); | 147 print('print within test'); |
148 } | 148 } |
149 """); | 149 """); |
150 var suites = await _loader.loadFile(p.join(_sandbox, 'a_test.dart')) | 150 var suites = await _loader.loadFile(p.join(_sandbox, 'a_test.dart')) |
151 .toList(); | 151 .toList(); |
152 expect(suites, hasLength(1)); | 152 expect(suites, hasLength(1)); |
153 var loadSuite = suites.first; | 153 var loadSuite = suites.first; |
154 | 154 |
155 var liveTest = await loadSuite.group.entries.single.load(loadSuite); | 155 var liveTest = await loadSuite.group.entries.single.load(loadSuite); |
156 expect(liveTest.onPrint.first, completion(equals("print within test"))); | 156 expect(liveTest.onMessage.first.then((message) => message.text), |
| 157 completion(equals("print within test"))); |
157 await liveTest.run(); | 158 await liveTest.run(); |
158 expectTestPassed(liveTest); | 159 expectTestPassed(liveTest); |
159 }); | 160 }); |
160 | 161 |
161 // 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 |
162 // are piped through the suite. Also for browser tests! | 163 // are piped through the suite. Also for browser tests! |
163 } | 164 } |
OLD | NEW |