enzyme icon indicating copy to clipboard operation
enzyme copied to clipboard

Typescript setup documentation

Open camurai opened this issue 7 years ago • 2 comments

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.

camurai avatar Oct 15 '17 01:10 camurai

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() });

mikebridge avatar Dec 22 '17 22:12 mikebridge

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() });

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...

retailSteveDave avatar Apr 19 '19 15:04 retailSteveDave