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](#writing-tests) | 3 * [Writing Tests](#writing-tests) |
4 * [Running Tests](#running-tests) | 4 * [Running Tests](#running-tests) |
5 * [Restricting Tests to Certain Platforms](#restricting-tests-to-certain-platf
orms) | 5 * [Restricting Tests to Certain Platforms](#restricting-tests-to-certain-platf
orms) |
6 * [Platform Selector Syntax](#platform-selector-syntax) | 6 * [Platform Selectors](#platform-selectors) |
7 * [Running Tests on Dartium](#running-tests-on-dartium) | 7 * [Running Tests on Dartium](#running-tests-on-dartium) |
8 * [Asynchronous Tests](#asynchronous-tests) | 8 * [Asynchronous Tests](#asynchronous-tests) |
9 * [Running Tests With Custom HTML](#running-tests-with-custom-html) | 9 * [Running Tests With Custom HTML](#running-tests-with-custom-html) |
10 * [Configuring Tests](#configuring-tests) | 10 * [Configuring Tests](#configuring-tests) |
11 * [Skipping Tests](#skipping-tests) | 11 * [Skipping Tests](#skipping-tests) |
12 * [Timeouts](#timeouts) | 12 * [Timeouts](#timeouts) |
13 * [Platform-Specific Configuration](#platform-specific-configuration) | 13 * [Platform-Specific Configuration](#platform-specific-configuration) |
14 * [Whole-Package Configuration](#whole-package-configuration) | 14 * [Whole-Package Configuration](#whole-package-configuration) |
15 * [Tagging Tests](#tagging-tests) | 15 * [Tagging Tests](#tagging-tests) |
16 * [Debugging](#debugging) | 16 * [Debugging](#debugging) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 ``` | 170 ``` |
171 | 171 |
172 [TestOn]: http://www.dartdocs.org/documentation/test/latest/index.html#test/test
.TestOn | 172 [TestOn]: http://www.dartdocs.org/documentation/test/latest/index.html#test/test
.TestOn |
173 | 173 |
174 The string you pass to `@TestOn` is what's called a "platform selector", and it | 174 The string you pass to `@TestOn` is what's called a "platform selector", and it |
175 specifies exactly which platforms a test can run on. It can be as simple as the | 175 specifies exactly which platforms a test can run on. It can be as simple as the |
176 name of a platform, or a more complex Dart-like boolean expression involving | 176 name of a platform, or a more complex Dart-like boolean expression involving |
177 these platform names. | 177 these platform names. |
178 | 178 |
179 ### Platform Selector Syntax | 179 ### Platform Selectors |
180 | 180 |
181 Platform selectors can contain identifiers, parentheses, and operators. When | 181 Platform selectors use the [boolean selector syntax][] defined in the |
182 loading a test, each identifier is set to `true` or `false` based on the current | 182 [`boolean_selector` package][boolean_selector], which is a subset of Dart's |
183 platform, and the test is only loaded if the platform selector returns `true`. | 183 expression syntax that only supports boolean operations. The following |
184 The operators `||`, `&&`, `!`, and `? :` all work just like they do in Dart. The | 184 identifiers are defined: |
185 valid identifiers are: | 185 |
| 186 [boolean selector syntax]: https://github.com/dart-lang/boolean_selector/blob/ma
ster/README.md |
| 187 |
| 188 [boolean_selector]: https://pub.dartlang.org/packages/boolean_selector |
186 | 189 |
187 * `vm`: Whether the test is running on the command-line Dart VM. | 190 * `vm`: Whether the test is running on the command-line Dart VM. |
188 | 191 |
189 * `dartium`: Whether the test is running on Dartium. | 192 * `dartium`: Whether the test is running on Dartium. |
190 | 193 |
191 * `content-shell`: Whether the test is running on the headless Dartium content | 194 * `content-shell`: Whether the test is running on the headless Dartium content |
192 shell. | 195 shell. |
193 | 196 |
194 * `chrome`: Whether the test is running on Google Chrome. | 197 * `chrome`: Whether the test is running on Google Chrome. |
195 | 198 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 available to tests. | 637 available to tests. |
635 | 638 |
636 [api]: http://www.dartdocs.org/documentation/test/latest/index.html | 639 [api]: http://www.dartdocs.org/documentation/test/latest/index.html |
637 | 640 |
638 The test runner also supports a machine-readable JSON-based reporter. This | 641 The test runner also supports a machine-readable JSON-based reporter. This |
639 reporter allows the test runner to be wrapped and its progress presented in | 642 reporter allows the test runner to be wrapped and its progress presented in |
640 custom ways (for example, in an IDE). See [the protocol documentation][json] for | 643 custom ways (for example, in an IDE). See [the protocol documentation][json] for |
641 more details. | 644 more details. |
642 | 645 |
643 [json]: https://github.com/dart-lang/test/blob/master/doc/json_reporter.md | 646 [json]: https://github.com/dart-lang/test/blob/master/doc/json_reporter.md |
OLD | NEW |