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
feat(cli): prioritize args over config (fix #710) #715
feat(cli): prioritize args over config (fix #710) #715
Conversation
✔️ Deploy Preview for vitest-dev ready! 🔨 Explore the source changes: d1bc4cd 🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/6203b93411e18300073b6f31 😎 Browse the preview: https://deploy-preview-715--vitest-dev.netlify.app |
Maybe we should wait for #702 and do it there? |
Just had a look at #702. I think it there's no real overlap here. Some noteworthy points:
I'll create a PR to #702 |
@@ -16,21 +16,21 @@ cli | |||
.option('-w, --watch', 'watch mode') | |||
.option('-t, --testNamePattern <pattern>', 'run test names with the specified pattern') | |||
.option('--ui', 'enable UI') | |||
.option('--open', 'open UI automatically', { default: true }) | |||
.option('--open', 'open UI automatically') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will remove (default: true)
text from vitest --help
output. We can add this to option description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add them
Will be merged as part of #702 |
Closes #710.
To prioritise CLI args over the config, we have to merge the former last.
However, our usage of CLI default args would result in the test config always being override if an option has a default value set.
To prevent this, I extracted the CLI default args and gave them the lowest priority.