Skip to content
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

Closed

Conversation

DerYeger
Copy link
Member

@DerYeger DerYeger commented Feb 9, 2022

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.

@netlify
Copy link

netlify bot commented Feb 9, 2022

✔️ 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

@sheremet-va
Copy link
Member

Maybe we should wait for #702 and do it there?

@DerYeger
Copy link
Member Author

DerYeger commented Feb 9, 2022

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.
The issue this PR addresses in particular are the CLI default options, since they have to have a separate priority than the custom CLI options.

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')
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add them

@DerYeger
Copy link
Member Author

DerYeger commented Feb 9, 2022

Will be merged as part of #702

@DerYeger DerYeger closed this Feb 9, 2022
@DerYeger DerYeger deleted the feat/710_prioritize_args_over_config branch February 9, 2022 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watch mode behaviour can't be override from CLI
3 participants