enzyme
enzyme copied to clipboard
Typescript setup documentation
add additional instructions to install types for enzyme and enzyme-adapter-react-16 for typescript as well as the change to the setup file to include import * as Adapter from 'enzyme-adapter-react-16'; as just "import Adapter..." from does not work.
I couldn't get any variant of import
working in TypeScript 2.6 & React 16 so I switched to require
:
import { configure } from "enzyme";
const Adapter = require("enzyme-adapter-react-16");
configure({ adapter: new Adapter() });
I couldn't get any variant of
import
working in TypeScript 2.6 & React 16 so I switched torequire
:import { configure } from "enzyme"; const Adapter = require("enzyme-adapter-react-16"); configure({ adapter: new Adapter() });
This is what ended up working for me after browsing not only this thread, but this one as well. Now I'm on to the next error...