| 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 'package:scheduled_test/descriptor.dart' as d; | 7 import 'package:scheduled_test/descriptor.dart' as d; |
| 8 import 'package:scheduled_test/scheduled_stream.dart'; | 8 import 'package:scheduled_test/scheduled_stream.dart'; |
| 9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
| 10 | 10 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 }); | 204 }); |
| 205 | 205 |
| 206 test("on a browser and the VM", () { | 206 test("on a browser and the VM", () { |
| 207 d.file("test.dart", _success).create(); | 207 d.file("test.dart", _success).create(); |
| 208 var test = runTest(["-p", "content-shell", "-p", "vm", "test.dart"]); | 208 var test = runTest(["-p", "content-shell", "-p", "vm", "test.dart"]); |
| 209 | 209 |
| 210 test.stdout.expect(consumeThrough(contains("+2: All tests passed!"))); | 210 test.stdout.expect(consumeThrough(contains("+2: All tests passed!"))); |
| 211 test.shouldExit(0); | 211 test.shouldExit(0); |
| 212 }); | 212 }); |
| 213 | 213 |
| 214 test("with setUpAll", () { |
| 215 d.file("test.dart", r""" |
| 216 import 'package:test/test.dart'; |
| 217 |
| 218 void main() { |
| 219 setUpAll(() => print("in setUpAll")); |
| 220 |
| 221 test("test", () {}); |
| 222 } |
| 223 """).create(); |
| 224 |
| 225 var test = runTest(["-p", "content-shell", "test.dart"]); |
| 226 test.stdout.expect(consumeThrough(contains('+0: (setUpAll)'))); |
| 227 test.stdout.expect('in setUpAll'); |
| 228 test.shouldExit(0); |
| 229 }); |
| 230 |
| 231 test("with tearDownAll", () { |
| 232 d.file("test.dart", r""" |
| 233 import 'package:test/test.dart'; |
| 234 |
| 235 void main() { |
| 236 tearDownAll(() => print("in tearDownAll")); |
| 237 |
| 238 test("test", () {}); |
| 239 } |
| 240 """).create(); |
| 241 |
| 242 var test = runTest(["-p", "content-shell", "test.dart"]); |
| 243 test.stdout.expect(consumeThrough(contains('+1: (tearDownAll)'))); |
| 244 test.stdout.expect('in tearDownAll'); |
| 245 test.shouldExit(0); |
| 246 }); |
| 247 |
| 214 // Regression test; this broke in 0.12.0-beta.9. | 248 // Regression test; this broke in 0.12.0-beta.9. |
| 215 test("on a file in a subdirectory", () { | 249 test("on a file in a subdirectory", () { |
| 216 d.dir("dir", [d.file("test.dart", _success)]).create(); | 250 d.dir("dir", [d.file("test.dart", _success)]).create(); |
| 217 | 251 |
| 218 var test = runTest(["-p", "chrome", "dir/test.dart"]); | 252 var test = runTest(["-p", "chrome", "dir/test.dart"]); |
| 219 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); | 253 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); |
| 220 test.shouldExit(0); | 254 test.shouldExit(0); |
| 221 }); | 255 }); |
| 222 | 256 |
| 223 group("with a custom HTML file", () { | 257 group("with a custom HTML file", () { |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 test("success", () {}); | 644 test("success", () {}); |
| 611 } | 645 } |
| 612 ''').create(); | 646 ''').create(); |
| 613 | 647 |
| 614 var test = runTest(["-p", "content-shell", "test.dart"]); | 648 var test = runTest(["-p", "content-shell", "test.dart"]); |
| 615 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); | 649 test.stdout.expect(consumeThrough(contains("+1: All tests passed!"))); |
| 616 test.shouldExit(0); | 650 test.shouldExit(0); |
| 617 }); | 651 }); |
| 618 }); | 652 }); |
| 619 } | 653 } |
| OLD | NEW |