Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enzyme - TS2350: Only a void function can be called with the 'new' keyword

After configuring the following:

import * as enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';

enzyme.configure({ adapter: new Adapter() });

When running jest --watch, everything works as expected. But, when running webpack --watch, I get: TS2350: Only a void function can be called with the 'new' keyword.

I couldn't find a solution, and I don't understand what's wrong.

I would love to get a hand. Thanks.

like image 555
alexunder Avatar asked Feb 27 '19 14:02

alexunder


1 Answers

I missed yarn add @types/enzyme-adapter-react-16

That fixed it.

like image 180
alexunder Avatar answered Sep 19 '22 12:09

alexunder