OLD | NEW |
---|---|
1 Each package may include a configuration file that applies to the package as a | 1 Each package may include a configuration file that applies to the package as a |
2 whole. This file can be used to provide custom defaults for various options, to | 2 whole. This file can be used to provide custom defaults for various options, to |
3 define configuration for multiple files, and more. | 3 define configuration for multiple files, and more. |
4 | 4 |
5 The file is named `dart_test.yaml` and lives at the root of the package, next to | 5 The file is named `dart_test.yaml` and lives at the root of the package, next to |
6 the package's pubspec. Like the pubspec, it's a [YAML][] file. Here's an | 6 the package's pubspec. Like the pubspec, it's a [YAML][] file. Here's an |
7 example: | 7 example: |
8 | 8 |
9 [YAML]: http://yaml.org/ | 9 [YAML]: http://yaml.org/ |
10 | 10 |
11 ```yaml | 11 ```yaml |
12 # This package's tests are very slow. Double the default timeout. | 12 # This package's tests are very slow. Double the default timeout. |
13 timeout: 2x | 13 timeout: 2x |
14 | 14 |
15 # This is a browser-only package, so test on content shell by default. | 15 # This is a browser-only package, so test on content shell by default. |
16 platforms: [content-shell] | 16 platforms: [content-shell] |
17 ``` | 17 ``` |
18 | 18 |
19 * [Config Fields](#config-fields) | 19 * [Config Fields](#config-fields) |
20 | 20 |
21 ## Config Fields | 21 ## Config Fields |
22 | 22 |
23 These fields directly affect the behavior of the test runner. They go at the | 23 These fields directly affect the behavior of the test runner. They go at the |
24 root of the configuration file. | 24 root of the configuration file. |
25 | 25 |
26 ### `paths` | |
27 | |
28 This field indicates the default paths that the test runner should run. These | |
29 paths are usually directories, although single filenames may be used as well. | |
30 Paths must be relative, and they must be in URL format so that they're | |
kevmoo
2016/02/04 17:50:05
URL format meaning...forward slashes?
nweiz
2016/02/04 20:06:47
That's the most obvious thing, but it also means t
| |
31 compatible across operating systems. This defaults to `[test]`. | |
32 | |
33 ```yaml | |
34 paths: [dart/test] | |
35 | |
36 paths: | |
37 - test/instantaneous | |
38 - test/fast | |
39 - test/middling | |
40 ``` | |
41 | |
42 ### `filename` | |
43 | |
44 This field indicates the filename pattern that the test runner uses to find test | |
45 files in directories. All files in directories passed on the command line (or in | |
46 directories in [`paths`](#paths), if none are passed) whose basenames match this | |
47 pattern will be loaded and run as tests. | |
48 | |
49 This supports the full [glob syntax][]. However, since it's only compared | |
50 against a path's basename, path separators aren't especially useful. It defaults | |
51 to `"*_test.dart"`. | |
52 | |
53 ```yaml | |
54 filename: "test_*.dart" | |
55 ``` | |
56 | |
57 [glob syntax]: https://github.com/dart-lang/glob#syntax | |
58 | |
26 ### `platforms` | 59 ### `platforms` |
27 | 60 |
28 This field indicates which platforms tests should run on by default. It allows | 61 This field indicates which platforms tests should run on by default. It allows |
29 the same paltform identifiers that can be passed to `--platform`. If multiple | 62 the same platform identifiers that can be passed to `--platform`. If multiple |
30 platforms are included, the test runner will default to running tests on all of | 63 platforms are included, the test runner will default to running tests on all of |
31 them. This defaults to `[vm]`. | 64 them. This defaults to `[vm]`. |
32 | 65 |
33 ```yaml | 66 ```yaml |
34 platforms: [content_shell] | 67 platforms: [content_shell] |
35 | 68 |
36 platforms: | 69 platforms: |
37 - chrome | 70 - chrome |
38 - firefox | 71 - firefox |
39 ``` | 72 ``` |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 | 140 |
108 This boolean field controls whether or not stack traces caused by errors that | 141 This boolean field controls whether or not stack traces caused by errors that |
109 occur while running Dart compiled to JS are converted back to Dart style. This | 142 occur while running Dart compiled to JS are converted back to Dart style. This |
110 conversion uses the source map generated by `dart2js` to approximate the | 143 conversion uses the source map generated by `dart2js` to approximate the |
111 original Dart line, column, and in some cases member name for each stack frame. | 144 original Dart line, column, and in some cases member name for each stack frame. |
112 It defaults to `false`. | 145 It defaults to `false`. |
113 | 146 |
114 ```yaml | 147 ```yaml |
115 js_trace: true | 148 js_trace: true |
116 ``` | 149 ``` |
OLD | NEW |