在Jest中测试React应用程序时,在命令行中使用酶的mount函数时,我得到以下错误。它显示未加载DOM环境,我认为这意味着我需要设置JSDOM。然而,根据Facebook的Jest文档,似乎。/src/components/MyComponent'import Adapter from 'enzyme-adapter-react-16'
import
我有一个反应应用程序,我想开始用酶编写单元测试。酶的讨论多达16种反应的版本。在src/setupTests.js中,我现在有import Adapter from 'enzyme-adapter-react-16';Enzyme.configure({ adapter: new Adapter() });
但我的应用程序使用的是Reactive17.0.1版本
我想用酶来测试我的反应--世博管理项目中的天然成分。我跟踪的文档,但现在我得到了:
Test environment found at "/Users/raarts/myproject/node_modules/jest-environment-enzyme/lib/index.js" does not export a "getVmContext" method, which is mandatory from Jest<
我安装了反应测试库和玩笑开始它。npm test
我得到以下错误。/Users/Tomascdmota/Downloads/Trust-Motores-main/node_modules/react-scripts/node_modules/jest-cli/buildObject.run (/Users/Tomascdmota/Downloads/Trust-Motores-main