Does Jest swallow console.log statements? Is there a way to change this?

后端 未结 5 678
借酒劲吻你
借酒劲吻你 2021-02-11 17:00

Does Jest swallow console.log output?

// __tests__/log.test.js

it(\'logs\', () => {
  console.log(\'hey\') // expect to see \"hey\" printed in t         


        
5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-11 17:54

    This seems to be an ongoing issue.

    With Node 10.7.0 and Jest 23.4.1, adding verbose: false to the jest config (per this suggestion) worked for me.

    Edit

    Now that I've gone to Jest 23.6 I also need to pass TERM=dumb as an environment variable, per Tamlyn's answer.

提交回复
热议问题