Prevent Jest from printing snapshot diffs

Viewed 92

This is how I currently invoke Jest in my project:

NODE_ENV=test ./node_modules/.bin/jest \
  --silent --watchAll=false --runInBand \
  --config=jest.config.js

I now want to run Jest without printing all the snapshot diffs. I still want to see error messages, console output, test success/failure, etc. I just want it to stop printing the snapshot diffs.

I am debugging something that is generating obviously-incorrect output (as reflected in the snapshots), and it is printing huge piles of diffs that are meaningless to me, because I know that they are wrong.

This is the jest.config.js file:

module.exports = {
  clearMocks: true,
  testMatch: ['**/tests/**/*.spec.[jt]s?(x)'],
  testPathIgnorePatterns: ['<rootDir>/node_modules/'],
  globalSetup: '<rootDir>/tests/setup.js',
  globalTeardown: '<rootDir>/tests/tearDown.js',
  transform: {
    '\\.(gql|graphql)$': '@jagi/jest-transform-graphql',
    '\\.js$': 'jest-esm-transformer'
  }
}
0 Answers
Related