0

In my package.json I have this jest test configuration:

 test: {
        default: `${crossEnv(
          'CI=false'
        )} react-scripts test --env=jsdom --verbose=false`,
        local: {
          default: 'react-scripts test --env=jsdom --coverage',
        },
        coverage: 'lerna exec npm start test.coverage',
        ci: `${crossEnv('CI=true')} react-scripts test --env=jsdom --coverage`,
  },

For some reason when I run a jest test and use console.log() the log is not displayed?

skyboyer
  • 22,209
  • 7
  • 57
  • 64
bier hier
  • 20,970
  • 42
  • 97
  • 166
  • Possible duplicate of [Console.log statements output nothing at all in Jest](https://stackoverflow.com/questions/48695717/console-log-statements-output-nothing-at-all-in-jest) – jonrsharpe Feb 11 '19 at 10:05

1 Answers1

1

This is a known issue in Jest as far as I know. What I usually do to bypass this is just expect(valueToLog).toBe('');

The solution here could work for you too.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437