-
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
Remove custom CLI flags in child worker before requiring test file #1393
Comments
IIRC I wasn't a fan of passing We also pass a JSON string as |
I know. It is convention though, but turns out to be annoying in this context.
Oh it shouldn't, but I don't think we should clutter it either. How about we pass whether to use colors or not in the argv[2] JSON string and handle it accordingly before requiring the test file? |
If you mean that for use cases under our control we use |
Yes, I mean our auto-detection.
Agreed. |
So from what I could gather from #1198, we pass on So, do we want colored text in test files to always display as colored? |
@kevva Yeah, basically, we want to pass on the auto-detect color support to the child worker, which always detects it as no color support, without clobbering |
To clarify, the worker will never detect color support itself, hence us needing to forward the detected support from the main process. (It read as ambiguous to me.) |
We already do that, I think. The only function |
This removes AVA's internal flags, set by fork.js and consumed by test-worker.js. Fixes #1393. AVA now forwards arguments, provided after an `--` argument terminator, to the worker process. Arguments are available from `process.argv[2]` onwards.
This removes AVA's internal flags, set by fork.js and consumed by test-worker.js. Fixes #1393. AVA now forwards arguments, provided after an `--` argument terminator, to the worker process. Arguments are available from `process.argv[2]` onwards.
We shouldn't expose custom CLI flags to the test file. It might change the behavior of user's code.
Currently we expose
--color
in the test file, even though the user just ran$ ava
with no flag.I had to implement a workaround for now: https://github.com/sindresorhus/xo-init/blob/9755f41134d0c8199674c1888d88cca3375358a3/test.js#L8
@novemberborn Thoughts?
The text was updated successfully, but these errors were encountered: