-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict between ava and nyc when nyc uses @babel/register. #2089
Comments
That's my preferred solution. Happy to take a PR to the documentation / recipes which brings up this edge-case. Ultimately you're changing the environment AVA is running in, breaking its assumptions. I don't think we need to cater to that. (I'm closing this issue for housekeeping purposes, but let's keep the conversation going.) |
CC @kevinji. @novemberborn this seems reasonable to me. Maybe it's possible/useful to capture the error and produce a more specific error from ava instead of letting the user see the node.js module loader stack trace? |
Yes, though looking at the code I'm not even sure how that error would occur: Line 17 in ebf4807
|
@kevinji @novemberborn I've investigated further, what we are seeing is standard-things/esm#773. So it looks like this will be fixed in the next release of esm. I've verified that with As an alternative @kevinji you could pin esm in your own package, |
@coreyfarrell Sweet, thanks for spending the time to look into the issue! |
Description
When something causes
@babel/register
to be required to the ava process this can cause a parse error for ava.config.js.Test Source
N/A
Error Message & Stack Trace
Config
Any
ava.config.js
ES module, even an empty config:babel.config.js
with@babel/plugin-transform-modules-commonjs
:Command-Line Arguments
Two commands can reproduce this:
Note the NODE_OPTIONS method is simply a way to show the problem isolated from nyc.
It is sometimes mandatory for
--require @babel/register
to be given to nyc. WIthout this it is impossible for nyc to generate coverage data for sources that were never loaded (nyc --all
).Work around
Adding
ignore: ["ava.config.js"]
tobabel.config.js
seems to make this issue go away.Relevant Links
See https://github.com/coreyfarrell/nyc-ava for minimal demo of issue.
npm test
andnpm run no-nyc
can be used to initiate the failure.Environment
The text was updated successfully, but these errors were encountered: