Type object
File match ava.config.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/ava-configuration/latest.json
Source https://www.schemastore.org/ava.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Configuration Schema for the JavaScript test runner AVA

Properties

files path[]
ignoredByWatcher path[]
match path[]
cache boolean

Defaults to true to cache compiled files under node_modules/.cache/ava. If false, files are cached in a temporary directory instead

Default: true
concurrency number

Max number of test files running at the same time (default: CPU cores)

workerThreads boolean

Use worker threads to run tests (enabled by default). If false, tests will run in child processes

Default: true
failFast boolean

Stop running further tests once a test fails

Default: false
failWithoutAssertions boolean

If false, does not fail a test if it doesn't run assertions

Default: true
environmentVariables Record<string, string>

Specifies environment variables to be made available to the tests. The environment variables defined here override the ones from process.env

serial boolean

if true, prevents parallel execution of tests within a file

Default: false
tap boolean

If true, enables the TAP reporter

Default: false
verbose boolean

If true, enables verbose output (though currently non-verbose output is not supported)

Default: false
snapshotDir string
minLength=1
extensions array-of-strings | object

Extensions of test files. Setting this overrides the default ["cjs", "mjs", "js"] value, so make sure to include those extensions in the list. Experimentally you can configure how files are loaded

Default:
[
  "cjs",
  "mjs",
  "js"
]
require path[]
timeout number | string

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 for more options

Default: "10s"
nodeArguments string[]
utilizeParallelBuilds boolean

If false, disable parallel builds (default: true)

Default: true
typescript object

Configures @ava/typescript for projects that precompile TypeScript. Alternatively, you can use ts-node to do live testing without transpiling, in which case you shouldn't use the typescript property

3 nested properties
extensions path[]
rewritePaths object

AVA searches your entire project for *.js, *.cjs, *.mjs and *.ts files (or other extensions you've configured). It will ignore such files found in the rewritePaths targets (e.g. build/). If you use more specific paths, for instance build/main/, you may need to change AVA's files configuration to ignore other directories. Paths are relative to your project directory

compile enum

If false, AVA will assume you have already compiled your project. If set to 'tsc', AVA will run the TypeScript compiler before running your tests. This can be inefficient when using AVA in watch mode

Default: false
Values: false "tsc"

Definitions

path string
array-of-strings string[]
array-of-paths path[]