TypeError: environment.setup is not a function in React Testing

后端 未结 7 1968
伪装坚强ぢ
伪装坚强ぢ 2021-02-12 08:44

I was trying to implement the example shown in Jest website: Getting started with Jest.

While running npm test on I was getting the following error:

<
7条回答
  •  你的背包
    2021-02-12 08:52

    This is an older issue but I was facing the same problem. We have react-scripts package and it uses Jest version 20.x.x which has problems with coverageTreshold. I couldn't use newer react-scripts version and the only thing helped was to use yarn resolutions, read more here https://yarnpkg.com/lang/en/docs/selective-version-resolutions/.

提交回复
热议问题