It's kind of covered by the code coverage recipe, but it might be good to have a simpler recipe that didn't include that.
Some stuff from this comment would apply here as well.
See https://github.com/jamestalmage/__ava-0.8-with-babel-6 for a working example
Repository name is a misnomer now - it uses [email protected].
It would also be great to have a recipe of how to use ava with rollup.
@boutros What do you mean? Rollup is a module bundler鈥攕urely you aren't bundling AVA for production right?
Rollup is a module bundler鈥攕urely you aren't bundling AVA for production right?
No, not for production of course. Anyway I solved it with rollup, so my remark can be ignored. If anyone is interested here is the relevant commit: https://github.com/boutros/koblersken/commit/c00e3a098c035c7a585ab72d1dde91fd2ac47e91
It's easy to get lost in the javascript build jungle :)
I think we're kinda already covering this. Of course if you use new language features that are supported by your targeted Node.js version you don't need to do anything special. If you need to transpile your source code we've covered that in the Transpiling imported modules section.
I'm closing this issue, but if you have ideas on how to improve the documentation please open a new issue or PR!
TL;DR: If you're using Rollup and no babel in your workflow, building a cjs bundle and requiring it in your tests works fine.
Details:
I've just started using ava and ran into the es6 modules problem. But because my repo uses Rollup to a cjs bundle (to be node friendly) I just require that in the test file. Ava is OK with that.
Here's an article on the "modern workflow" idea where Rollup is used to convert a bleeding edge project into any format you'd like:
https://medium.com/@backspaces/es6-modules-part-1-migration-strategy-a48de0b7f112
Most helpful comment
It would also be great to have a recipe of how to use ava with rollup.