| 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:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 }); | 216 }); |
| 217 }); | 217 }); |
| 218 | 218 |
| 219 test("gracefully handles pub serve not running for VM tests", () { | 219 test("gracefully handles pub serve not running for VM tests", () { |
| 220 var result = runUnittest(['--pub-serve=54321'], | 220 var result = runUnittest(['--pub-serve=54321'], |
| 221 workingDirectory: _sandbox); | 221 workingDirectory: _sandbox); |
| 222 expect(result.stdout, allOf([ | 222 expect(result.stdout, allOf([ |
| 223 contains('-1: load error'), | 223 contains('-1: load error'), |
| 224 contains(''' | 224 contains(''' |
| 225 Failed to load "test/my_test.dart": | 225 Failed to load "test/my_test.dart": |
| 226 Error getting http://localhost:54321/my_test.vm_test.dart: Connection refused | 226 Error getting http://localhost:54321/my_test.dart.vm_test.dart: Connection ref
used |
| 227 Make sure "pub serve" is running.''') | 227 Make sure "pub serve" is running.''') |
| 228 ])); | 228 ])); |
| 229 expect(result.exitCode, equals(1)); | 229 expect(result.exitCode, equals(1)); |
| 230 }); | 230 }); |
| 231 | 231 |
| 232 test("gracefully handles pub serve not running for browser tests", () { | 232 test("gracefully handles pub serve not running for browser tests", () { |
| 233 var result = runUnittest(['--pub-serve=54321', '-p', 'chrome'], | 233 var result = runUnittest(['--pub-serve=54321', '-p', 'chrome'], |
| 234 workingDirectory: _sandbox); | 234 workingDirectory: _sandbox); |
| 235 expect(result.stdout, allOf([ | 235 expect(result.stdout, allOf([ |
| 236 contains('-1: load error'), | 236 contains('-1: load error'), |
| 237 contains('Failed to load "test/my_test.dart":'), | 237 contains('Failed to load "test/my_test.dart":'), |
| 238 contains('Error getting http://localhost:54321/my_test.browser_test.dart' | 238 contains('Error getting http://localhost:54321/my_test.dart.browser_test' |
| 239 '.js: Connection refused (errno '), | 239 '.dart.js: Connection refused (errno '), |
| 240 contains('Make sure "pub serve" is running.') | 240 contains('Make sure "pub serve" is running.') |
| 241 ])); | 241 ])); |
| 242 expect(result.exitCode, equals(1)); | 242 expect(result.exitCode, equals(1)); |
| 243 }); | 243 }); |
| 244 | 244 |
| 245 test("gracefully handles a test file not being in test/", () { | 245 test("gracefully handles a test file not being in test/", () { |
| 246 new File(p.join(_sandbox, 'test/my_test.dart')) | 246 new File(p.join(_sandbox, 'test/my_test.dart')) |
| 247 .copySync(p.join(_sandbox, 'my_test.dart')); | 247 .copySync(p.join(_sandbox, 'my_test.dart')); |
| 248 | 248 |
| 249 var result = runUnittest(['--pub-serve=54321', 'my_test.dart'], | 249 var result = runUnittest(['--pub-serve=54321', 'my_test.dart'], |
| 250 workingDirectory: _sandbox); | 250 workingDirectory: _sandbox); |
| 251 expect(result.stdout, allOf([ | 251 expect(result.stdout, allOf([ |
| 252 contains('-1: load error'), | 252 contains('-1: load error'), |
| 253 contains( | 253 contains( |
| 254 'Failed to load "my_test.dart": When using "pub serve", all test ' | 254 'Failed to load "my_test.dart": When using "pub serve", all test ' |
| 255 'files must be in test/.\n') | 255 'files must be in test/.\n') |
| 256 ])); | 256 ])); |
| 257 expect(result.exitCode, equals(1)); | 257 expect(result.exitCode, equals(1)); |
| 258 }); | 258 }); |
| 259 } | 259 } |
| OLD | NEW |