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

fix: firefoxPreview option should be set to mv3 only when explicitly requested #2454

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

rpl
Copy link
Member

@rpl rpl commented Jul 8, 2022

The --firefox-preview web-ext option we introduced in v7.1.0 should not default to mv3 if it wasn't explicitly passed as an option (either on the command line or through the web-ext config file).

Unfortunately setting a default value through the yargs default property will always set argv.firefoxPreview to ['mv3'] even when it is not explicitly passed, demandOptions set to false makes the cli option not mandatory but it doesn't ignore the default value.

This PR adds an additional test case to make sure that argv.firefoxPreview is undefined when not explicitly passed as an option, and a small tweak to program.js that make sure argv.firefoxPreview defaults to ['mv3'] if it was set to an empty array (and so when --firefox-preview was explicitly passed but without any value specified explicitly).

@rpl
Copy link
Member Author

rpl commented Jul 8, 2022

@willdurand my apologies, I should have caught this during the review.

@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #2454 (a2919a6) into master (7f2346a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2454   +/-   ##
=======================================
  Coverage   99.74%   99.74%           
=======================================
  Files          31       31           
  Lines        1552     1554    +2     
=======================================
+ Hits         1548     1550    +2     
  Misses          4        4           
Impacted Files Coverage Δ
src/program.js 98.55% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f2346a...a2919a6. Read the comment docs.

@willdurand
Copy link
Member

oops

@rpl rpl merged commit 8cb4d8c into master Jul 8, 2022
@rpl rpl deleted the fix/web-ext-run-preview-default branch July 8, 2022 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants