-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest --silent --no-silent no longer negates silent flag #9517
Comments
We use Test file: const { argv } = require('yargs').option('silent', { type: 'boolean' });
console.log(argv);
$ node file.js --silent --no-silent --silent
{ _: [], silent: true, '$0': 'file.js' }
$ node file.js --silent --no-silent --silent
{ _: [], silent: [ true, false, true ], '$0': 'file.js' } This feels like a bug... We tell yargs we want a boolean, and it gives us back an array of booleans? @bcoe thoughts? We just do |
@SimenB you should be able to address this by passing a configuration setting to yargs, we've made this behavior more explicit, see: https://github.com/yargs/yargs-parser#duplicate-arguments-array Set
Edit: |
Thanks! Through some trial and error I got to |
@jensbodal this was fixed in yargs, so you should be able to just update the version of yargs in your project |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
💥 Regression Report
Our
package.json
script runs jest with the--silent
flag. Previously I was able to override this by passing--no-silent
flag when running the script.Last working version
Worked up to version:
~24.8.0
(specifically24.8.0
is installed)Stopped working in version:
~25.1.0
To Reproduce
package.json
script:console.log
statement to a testnpm run test:silent
and observe log statement isn't logged (expected)npm run test:no:silent
and observe log statement is logged (expected)npm run test:silent -- --no-silent
and observe log statement isn't logged (regression, this used to work)Expected behavior
Expect
no-silent
to negate--silent
flag.Link to repl or repo (highly encouraged)
https://repl.it/repls/DownrightTrivialCalculator
Switch to version 24 to see it work. Basically run the
test:negate:silent
script and it will work with version 24 but not with version 25.Issues without a reproduction link are likely to stall.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: