ES6 import for 'ava' test not working

there is a far easier way to work with ES module for AVA

$ npm install esm --save-dev 

Then in your package.json add


{
    "ava": {
        "require": [
            "esm"
        ]
    }
}

Babel never works correctly, I spend more time on debugging the tool then my code with all this pile of CS everyday!


Add to your package.json

"ava": {
  "files": [
    "test/**/*.js"
  ],
  "require": [
    "babel-register"
  ],
  "babel": "inherit"
},

Your .babelrc

{
  "presets": ["es2015"]
}

And then your imports should work.