配置以下内容:
import * as enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
enzyme.configure({ adapter: new Adapter() });
运行jest --watch
时,一切都按预期工作。但是,运行webpack --watch
时,我会得到: TS2350: Only a void function can be called with the 'new' keyword.
我找不到解决方案,我不明白怎么了。
我很想握手。谢谢。
我错过了 yarn add @types/enzyme-adapter-react-16
修复了它。