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
Copy file name to clipboardExpand all lines: docs/01-writing-tests.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,11 @@ You must define all tests synchronously. They can't be defined inside `setTimeou
8
8
9
9
AVA tries to run test files with their current working directory set to the directory that contains your `package.json` file.
10
10
11
-
## Process isolation
11
+
## Test isolation
12
12
13
-
Each test file is run in a separate Node.js process. This allows you to change the global state or overriding a built-in in one test file, without affecting another. It's also great for performance on modern multi-core processors, allowing multiple test files to execute in parallel.
13
+
AVA 3 runs each test file in a separate Node.js process. This allows you to change the global state or overriding a built-in in one test file, without affecting another.
14
+
15
+
AVA 4 runs each test file in a new worker thread, though you can fall back to AVA 3's behavior of running in separate processes.
14
16
15
17
AVA will set `process.env.NODE_ENV` to `test`, unless the `NODE_ENV` environment variable has been set. This is useful if the code you're testing has test defaults (for example when picking what database to connect to). It may cause your code or its dependencies to behave differently though. Note that `'NODE_ENV' in process.env` will always be `true`.
Copy file name to clipboardExpand all lines: docs/06-configuration.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,7 @@ Arguments passed to the CLI will always take precedence over the CLI options con
47
47
-`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)
48
48
-`cache`: cache compiled files under `node_modules/.cache/ava`. If `false`, files are cached in a temporary directory instead
49
49
-`concurrency`: max number of test files running at the same time (default: CPU cores)
50
+
-`workerThreads`: use worker threads to run tests (requires AVA 4, enabled by default). If `false`, tests will run in child processes (how AVA 3 behaves)
50
51
-`failFast`: stop running further tests once a test fails
51
52
-`failWithoutAssertions`: if `false`, does not fail a test if it doesn't run [assertions](./03-assertions.md)
52
53
-`environmentVariables`: specifies environment variables to be made available to the tests. The environment variables defined here override the ones from `process.env`
0 commit comments