jest --silent --no-silent no longer negates silent flag
See original GitHub issue💥 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.
npm run test -- --no-silent
Last working version
Worked up to version: ~24.8.0 (specifically 24.8.0 is installed)
Stopped working in version: ~25.1.0
To Reproduce
- Create
package.jsonscript:
"test:silent": "jest --silent --config jest.config.js",
"test:no-silent": "jest --no-silent --config jest.config.js",
"test:negate:silent": "npm run test:silent -- --no-silent",
- Add a
console.logstatement to a test - Run
npm run test:silentand observe log statement isn’t logged (expected) - Run
npm run test:no:silentand observe log statement is logged (expected) - Run
npm run test:silent -- --no-silentand 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:
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Binaries:
Node: 8.17.0 - ~/local/n/n/versions/node/8.17.0/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.13.4 - ~/local/n/n/versions/node/8.17.0/bin/npm
npmPackages:
jest: ~25.1.0 => 25.1.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Make certain test silent in Jest - Stack Overflow
Looks like jest --silent makes all tests silent, which is not desirable. I need to simulate an error and make sure it's correctly...
Read more >Jest CLI Options
The jest command line runner has a number of useful options. You can run jest --help to view all available options. Many of...
Read more >6 Ways to Run Jest Test Cases Silently - Medium
With a large amount of test cases, there might be a large amount of console information from the code, which you may not...
Read more >是- 不沉默- 不再否定沉默国旗:jest-silent-no-silent no longer negates ...
jest -silent-no-silent no longer negates silent flag Regression Report Our package.json script runs jest with the-silent flag. Previously I was able ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@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
duplicate-arguments-arraytofalse:~yargs.parserOptions({‘duplicate-arguments-array’: false});~
Edit:
yargs(process.argv.slice(2)).parserConfiguration({}), I should learn how to use yargs.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. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.