It could be useful to be able to de define the flags of the Node process running AVA. A comment by @novemberborn scratch the surface, but apparently it never got raised as a request.
Any compatible Node flag could be listed.
Adding the --nodeArgs``--node-args--node-arguments to AVA could allow the user to execute Node with some needed flags.
(eg: ava --node-arguments --experimental-report)
It should also be available as an AVA config property:
{
"ava": {
"nodeArguments": [
"--experimental-report",
"- --custom-arg"
]
}
}
process.execArgv.includes("--experimental-policy"); // <= Never true
IssueHunt Summary
IssueHunt has been backed by the following sponsors. Become a sponsor
Thanks for opening this, @GMartigny. Should it be --node-args though?
@novemberborn, yes you're right since --update-snapshots and --reset-cache are kebab-case.
I would prefer --node-arguments. You don't really gain much from shortening it.
It should also be possible to set it as a AVA config property.
It should also be possible to set it as a AVA config property
As a string, an array or both ?
It should also be possible to set it as a AVA config property
As a string, an array or both ?
Array.
Are there use cases for specifying these flags as a one-off when you run AVA through the CLI, or should we only support them as a config property, since you'd want to use them all the time?
I would say both. For example, you get a warning that you're using a deprecated Node.js API, but it doesn't show a stack trace, so you need to pass in a certain CLI argument to Node.js to force it to show where the warning came from. You only need that once.
Are there use cases for specifying these flags as a one-off when you run AVA through the CLI
Off the top of my head, I see a difference between running test locally and through CI. Maybe for environment purpose too like no having the same flags on different node versions.
@issuehunt has funded $60.00 to this issue.
@sindresorhus has rewarded $54.00 to @maximelkin. See it on IssueHunt
Most helpful comment
@issuehunt has funded $60.00 to this issue.