OLD | NEW |
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 * `chrome`: Whether the test is running on Google Chrome. | 146 * `chrome`: Whether the test is running on Google Chrome. |
147 | 147 |
148 * `phantomjs`: Whether the test is running on | 148 * `phantomjs`: Whether the test is running on |
149 [PhantomJS](http://phantomjs.org/). | 149 [PhantomJS](http://phantomjs.org/). |
150 | 150 |
151 * `firefox`: Whether the test is running on Mozilla Firefox. | 151 * `firefox`: Whether the test is running on Mozilla Firefox. |
152 | 152 |
153 * `safari`: Whether the test is running on Apple Safari. | 153 * `safari`: Whether the test is running on Apple Safari. |
154 | 154 |
| 155 * `ie`: Whether the test is running on Microsoft Internet Explorer. |
| 156 |
155 * `dart-vm`: Whether the test is running on the Dart VM in any context, | 157 * `dart-vm`: Whether the test is running on the Dart VM in any context, |
156 including Dartium. It's identical to `!js`. | 158 including Dartium. It's identical to `!js`. |
157 | 159 |
158 * `browser`: Whether the test is running in any browser. | 160 * `browser`: Whether the test is running in any browser. |
159 | 161 |
160 * `js`: Whether the test has been compiled to JS. This is identical to | 162 * `js`: Whether the test has been compiled to JS. This is identical to |
161 `!dart-vm`. | 163 `!dart-vm`. |
162 | 164 |
163 * `blink`: Whether the test is running in a browser that uses the Blink | 165 * `blink`: Whether the test is running in a browser that uses the Blink |
164 rendering engine. | 166 rendering engine. |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 472 |
471 In this case, the port is `8081`. In another terminal, pass this port to | 473 In this case, the port is `8081`. In another terminal, pass this port to |
472 `--pub-serve` and otherwise invoke `pub run test:test` as normal: | 474 `--pub-serve` and otherwise invoke `pub run test:test` as normal: |
473 | 475 |
474 ```shell | 476 ```shell |
475 $ pub run test:test --pub-serve=8081 -p chrome | 477 $ pub run test:test --pub-serve=8081 -p chrome |
476 "pub serve" is compiling test/my_app_test.dart... | 478 "pub serve" is compiling test/my_app_test.dart... |
477 "pub serve" is compiling test/utils_test.dart... | 479 "pub serve" is compiling test/utils_test.dart... |
478 00:00 +42: All tests passed! | 480 00:00 +42: All tests passed! |
479 ``` | 481 ``` |
OLD | NEW |