“ReferenceError: document is not defined” when trying to test a create-react-app project

前端 未结 4 2306
醉话见心
醉话见心 2021-02-18 13:42

This is my __tests__/App.js file:

import React from \'react\';
import ReactDOM from \'react-dom\';
import App from \'../src/containers/App\';

it(\'         


        
4条回答
  •  孤街浪徒
    2021-02-18 14:32

    If you are using create-react-app, make sure to run yarn test instead of yarn jest or something else.

提交回复
热议问题