You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Note that the CLI will use your local install of AVA when available, even when run globally.*
37
37
38
-
**FIXME**
38
+
AVA searches for test files using the following patterns:
39
39
40
-
Directories are recursed, with all `*.js` files being treated as test files. Directories named `fixtures`, `helpers` and `node_modules` are *always* ignored. So are files starting with `_` which allows you to place helpers in the same directory as your test files.
40
+
*`**/test.js`
41
+
*`**/test-*.js`
42
+
*`**/*.test.js`
43
+
*`**/test/**/*.js`
44
+
*`**/__tests__/**/*.js`
45
+
46
+
Files inside `node_modules` are *always* ignored. So are files starting with `_`. These are treated as helpers.
41
47
42
48
When using `npm test`, you can pass positional arguments directly `npm test test2.js`, but flags needs to be passed like `npm test -- --verbose`.
Copy file name to clipboardExpand all lines: docs/06-configuration.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Arguments passed to the CLI will always take precedence over the CLI options con
48
48
49
49
## Options
50
50
51
-
-`files`: **FIXME** file & directory paths and glob patterns that select which files AVA will run tests from. Files with an underscore prefix are ignored. All matched files in selected directories are run. By default only selects files with `js` extensions, even if the glob pattern matches other files. Specify `extensions` and `babel.extensions` to allow other file extensions
51
+
-`files`: glob patterns that select which files AVA will run tests from. Files with an underscore prefix are ignored. By default only selects files with `js` extensions, even if the glob pattern matches other files. Specify `extensions` and `babel.extensions` to allow other file extensions
52
52
-`sources`: files that, when changed, cause tests to be re-run in watch mode. See the [watch mode recipe for details](https://github.com/avajs/ava/blob/master/docs/recipes/watch-mode.md#source-files-and-test-files)
53
53
-`match`: not typically useful in the `package.json` configuration, but equivalent to [specifying `--match` on the CLI](./05-command-line.md#running-tests-with-matching-titles)
54
54
-`cache`: cache compiled test and helper files under `node_modules/.cache/ava`. If `false`, files are cached in a temporary directory instead
@@ -64,7 +64,7 @@ Arguments passed to the CLI will always take precedence over the CLI options con
64
64
-`babel.extensions`: extensions of test files that will be precompiled using AVA's Babel presets. Setting this overrides the default `"js"` value, so make sure to include that extension in the list
65
65
-`timeout`: Timeouts in AVA behave differently than in other test frameworks. AVA resets a timer after each test, forcing tests to quit if no new test results were received within the specified timeout. This can be used to handle stalled tests. See our [timeout documentation](./07-test-timeouts.md) for more options.
66
66
67
-
**FIXME**Note that providing files on the CLI overrides the `files` option. If you've configured a glob pattern, for instance `test/**/*.test.js`, you may want to repeat it when using the CLI: `ava 'test/integration/*.test.js'`.
67
+
Note that providing files on the CLI overrides the `files` option.
Copy file name to clipboardExpand all lines: docs/08-common-pitfalls.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,12 +83,6 @@ test('one is one', t => {
83
83
});
84
84
```
85
85
86
-
### Helpers are not compiled when using a non-default test folder
87
-
88
-
**FIXME**
89
-
90
-
This is a [known issue](https://github.com/avajs/ava/issues/1319). You should put your tests in a folder called `test` or `__tests__`.
91
-
92
86
---
93
87
94
88
Is your problem not listed here? Submit a pull request or comment on [this issue](https://github.com/avajs/ava/issues/404).
Copy file name to clipboardExpand all lines: docs/recipes/watch-mode.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,16 +65,12 @@ AVA uses [`chokidar`] as the file watcher. Note that even if you see warnings ab
65
65
66
66
## Source files and test files
67
67
68
-
**FIXME**
69
-
70
68
In AVA there's a distinction between *source files* and *test files*. As you can imagine the *test files* contain your tests. *Source files* are all other files that are needed for the tests to run, be it your source code or test fixtures.
71
69
72
70
By default AVA watches for changes to the test files, snapshot files, `package.json`, and any other `.js` files. It'll ignore files in [certain directories](https://github.com/novemberborn/ignore-by-default/blob/master/index.js) as provided by the [`ignore-by-default`] package.
73
71
74
72
You can configure patterns for the source files in the [`ava` section of your `package.json`, or `ava.config.js` file][config], using the `sources` key.
75
73
76
-
You can specify patterns to match files in the folders that would otherwise be ignored, e.g. use `node_modules/some-dependency/*.js` to specify all `.js` files in `node_modules/some-dependency` as a source, even though normally all files in `node_modules` are ignored. Note that you need to specify an exact directory; `{bower_components,node_modules}/**/*.js` won't work.
77
-
78
74
If your tests write to disk they may trigger the watcher to rerun your tests. Configure patterns for the source files to avoid this.
0 commit comments