I have the following ava config in my package.json:
{
"ava": {
"require": [
"./tests/helpers/setup-browser-env.js",
"./tests/helpers/module-stubber.js",
"babel-register"
],
"babel": {
"presets": [
"es2015",
"stage-0",
"react"
]
},
"failFast": true,
"verbose": false,
"no-cache": false,
"concurrency": 5
}
}
and I have the following project structure:
src
index.jsx
components
input.jsx
tests
index.test.js
index.jsx
import Input from './components/input';
console.log(Input);
input.jsx
import react from 'react';
export default () => <input></input>;
input.test.js
import app from '../src';
// ...
The problem is that ava is able to transpile my src/index.jsx
file but it doesn't transpile input.jsx
and I am seing an empty object logged in my console. It only works if I import the component using the .jsx
extension like so: import Input from './component/input.jsx. I can't make it to work without specifying the extension.
Is this possible in AVA? In Webpack it is a simple config which handles these kinds of patterns.
Looking in the ava docs under the configuration section: https://github.com/avajs/ava#configuration I can't see any field which can help me. (also the config fields don't seem to be really detailed).
Any ideas?
Thanks in advance.