Search code examples
node.jsbabeljsava

updated Ava configuration using babel


We have recently updated from ava 0.17.0 to version 2.4.0. The old configuration in the package.json no longer works and ava tests now fail.

the old configuration in our package.json looks like the following

"ava": { "timeout": "10m", "files": [ "app//*Spec.js", "lib//*Spec.js", "*Spec.js" ], "source": [ "**/*.{js,jsx}" ], "babel": { "presets": [ [ "env", { "targets": { "node": "current" } } ] ] } },

Can someone please tell me what is the new configuration required for ava 2.4.0....?


Solution

  • Possibly you need to wrap the current babel value in a "testOptions" object, e.g. "babel": { "testOptions": { "presets": … } }. Hard to say more without seeing your errors.