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

后端 未结 7 1808
伪装坚强ぢ
伪装坚强ぢ 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 09:01

    My issue solve with this:
    .
    If you have both react-scripts and jest in your package.json, delete jest from it.
    Then delete package-lock.json, yarn.lock and node_modules.
    Then run npm install (or yarn if you use it). ~Dan Abramov~ . issues #5119 .

提交回复
热议问题