Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: README.md

Issue 1073983012: Update the README's "pub serve" section for polymer compatibility. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 `test` provides a standard way of writing and running tests in Dart. 1 `test` provides a standard way of writing and running tests in Dart.
2 2
3 ## Writing Tests 3 ## Writing Tests
4 4
5 Tests are specified using the top-level [`test()`][test] function, and test 5 Tests are specified using the top-level [`test()`][test] function, and test
6 assertions are made using [`expect()`][expect]: 6 assertions are made using [`expect()`][expect]:
7 7
8 [test]: http://www.dartdocs.org/documentation/test/latest/index.html#test/test@i d_test 8 [test]: http://www.dartdocs.org/documentation/test/latest/index.html#test/test@i d_test
9 [expect]: http://www.dartdocs.org/documentation/test/latest/index.html#test/test @id_expect 9 [expect]: http://www.dartdocs.org/documentation/test/latest/index.html#test/test @id_expect
10 10
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 instance rather than from the filesystem. **This feature is only supported on 448 instance rather than from the filesystem. **This feature is only supported on
449 Dart `1.9.2` and higher.** 449 Dart `1.9.2` and higher.**
450 450
451 Before using the `--pub-serve` option, add the `test/pub_serve` transformer to 451 Before using the `--pub-serve` option, add the `test/pub_serve` transformer to
452 your `pubspec.yaml`. This transformer adds the necessary bootstrapping code that 452 your `pubspec.yaml`. This transformer adds the necessary bootstrapping code that
453 allows the test runner to load your tests properly: 453 allows the test runner to load your tests properly:
454 454
455 ```yaml 455 ```yaml
456 transformers: 456 transformers:
457 - test/pub_serve: 457 - test/pub_serve:
458 $include: test/**_test.dart 458 $include: test/**_test{.*,}.dart
459 ```
460
461 Note that if you're using the test runner along with [`polymer`][polymer], you
462 have to make sure that the `test/pub_serve` transformer comes *after* the
463 `polymer` transformer:
464
465 [polymer]: https://www.dartlang.org/polymer/
466
467 ```yaml
468 transformer:
469 - polymer
470 - test/pub_serve:
471 $include: test/**_test{.*,}.dart
459 ``` 472 ```
460 473
461 Then, start up `pub serve`. Make sure to pay attention to which port it's using 474 Then, start up `pub serve`. Make sure to pay attention to which port it's using
462 to serve your `test/` directory: 475 to serve your `test/` directory:
463 476
464 ```shell 477 ```shell
465 $ pub serve 478 $ pub serve
466 Loading source assets... 479 Loading source assets...
467 Loading test/pub_serve transformers... 480 Loading test/pub_serve transformers...
468 Serving my_app web on http://localhost:8080 481 Serving my_app web on http://localhost:8080
469 Serving my_app test on http://localhost:8081 482 Serving my_app test on http://localhost:8081
470 Build completed successfully 483 Build completed successfully
471 ``` 484 ```
472 485
473 In this case, the port is `8081`. In another terminal, pass this port to 486 In this case, the port is `8081`. In another terminal, pass this port to
474 `--pub-serve` and otherwise invoke `pub run test:test` as normal: 487 `--pub-serve` and otherwise invoke `pub run test:test` as normal:
475 488
476 ```shell 489 ```shell
477 $ pub run test:test --pub-serve=8081 -p chrome 490 $ pub run test:test --pub-serve=8081 -p chrome
478 "pub serve" is compiling test/my_app_test.dart... 491 "pub serve" is compiling test/my_app_test.dart...
479 "pub serve" is compiling test/utils_test.dart... 492 "pub serve" is compiling test/utils_test.dart...
480 00:00 +42: All tests passed! 493 00:00 +42: All tests passed!
481 ``` 494 ```
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698