-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remove defaults for private code #611
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
Comments
I think we shouldn't do it, because those libraries/components should be stable on their own. They should not depend on other code passing these arguments correctly.
We can improve our checking of value types, using functions like |
Sure, they'd just require valid options to be passed. |
@avajs/core any thoughts on this? |
👍 Sounds good. |
We'll just do this when we're touching code. No need to keep the issue open. |
AVA exposes two public interfaces: the CLI and the programmatic API. All other code is private. Currently a lot of the private code has defaults, e.g.
Runner
can be instantiated withoutoptions
.This tends to happen in tests and causes confusion where code has to be extra defensive against scenarios that wouldn't occur if defaults were set at the public interface level.
Allowing defaults throughout the code makes it hard to reason about expected values. I'm proposing we remove defaults from internal code and make our tests more explicit.
Thoughts?
The text was updated successfully, but these errors were encountered: