酶 - TS2350:只能使用 'new' 关键字调用 void 函数



配置以下内容:

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

修复了它。

最新更新