Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Jest from printing all skipped tests?

Tags:

jestjs

I'm trying to run just one Jest test, and am I using the following command:

jest --config=jest.config.js --runInBand --bail --forceExit "services_rest_Api" "-t" "should list all tag notes"

With the following config:

module.exports = {
    testMatch: [
        '**/tests/**/*.js',
    ],
    testPathIgnorePatterns: [
        '/node_modules/',
        'tests/support/',
        'test-utils.js',
        'file_api_driver.js',
    ],
    testEnvironment: 'node',
    setupFilesAfterEnv: ['./jest.setup.js'],
};

Whenever I run this, it displays the filtered test on top, but also all the skipped one below:

 PASS  tests/services_rest_Api.js
  services_rest_Api
    ✓ should list all tag notes (852 ms)
    ○ skipped should ping
    ○ skipped should handle Not Found errors
    ○ skipped should get folders
    // ... And many more of these

Which means I need to scroll up by a lot to actually see the results for the test I was running. So I'm wondering, is there any way to prevent Jest from printing all these skipped tests? I didn't include the verbose anywhere so I thought it shouldn't print this but it still does. Any idea?

like image 593
laurent Avatar asked Oct 20 '25 15:10

laurent


1 Answers

To disable verbosity you could either set it:

cli
jest --verbose=false

or in:

jest.config.json/package.json
{
   "verbose": false
}

and even the documentations says by default it's false by default

it's enabled when you run tests for a single file

like image 182
Teneff Avatar answered Oct 24 '25 21:10

Teneff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!