✖ The --require and -r flags are deprecated. Requirements should be configured in package.json - see documentation.
Is there a particular reason for this?
This pains me:
package.json clean so far. Now i am forced to put ava fluff in there.CLI-flags can be removed all the way now since i am not going to put ava options in 2 different places.
Yes, that's the motivation. Having it in package.json makes it easier for external tools, like editor plugins, to use the same config.
Removing flexibility to a static "one config per package.json" seems pointless to me. You could still have both and the "static (pkg) > overwrites (cli)" model seems more reasonable to me.
Is there any way to have different requirements for different entry points within the same project with the current configuration model?
2 package.json files as far as i understood.
I'm running into an issue with this decision. While using zeit/micro for a server, which uses async-to-gen, I don't get accurate coverage data when using:
"require": [
"async-to-gen/register"
]
However, the tests run fine. If I want accurate coverage (from nyc), I have to go to latest node version and remove the require config. However, my build server can not be upgraded to latest yet. I'd like to have ava run tests under a cli switch and keep require out of my config so I can run coverage locally.
@AutoSponge I'd write a little wrapper module that checks the Node.js version and requires async-to-gen/register if it doesn't support async/await.
@novemberborn great idea. This worked for me.
if (!require('is-async-supported')()) {
require('async-to-gen/register')
}
Most helpful comment
Removing flexibility to a static "one config per package.json" seems pointless to me. You could still have both and the "static (pkg) > overwrites (cli)" model seems more reasonable to me.