Skip to content

Commit

Permalink
Enable JSX support and use preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Sep 8, 2020
1 parent 0949eaa commit 5e7279b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -30,17 +30,21 @@ Then, enable Babel support either in `package.json` or `ava.config.*`:

## Customize how AVA compiles your test files

You can override the default Babel configuration AVA uses for test file compilation in `package.json` or `ava.config.*`. For example, the configuration below adds support for JSX syntax and stage 3 features.
You can override the default Babel configuration AVA uses for test file compilation in `package.json` or `ava.config.*`. For example, the configuration below adds support for JSX syntax and [preset-env](https://babeljs.io/docs/en/babel-preset-env).

**`package.json`:**

```json
{
"ava": {
"babel": {
"extensions": [
"js",
"jsx"
],
"testOptions": {
"plugins": ["@babel/plugin-syntax-jsx"],
"presets": ["@babel/preset-stage-3"]
"presets": ["@babel/preset-env"]
}
}
}
Expand Down

0 comments on commit 5e7279b

Please sign in to comment.