wojtekmaj / enzyme-adapter-react-17

Unofficial adapter for React 17 for Enzyme.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enzyme Internal Error: configured enzyme adapter did not inherit from the EnzymeAdapter base class

scott-thrillist opened this issue · comments

Has anyone seen this error: Enzyme Internal Error: configured enzyme adapter did not inherit from the EnzymeAdapter base class

Using Enzyme version 3.11.0 and here's my simple setup:

import { configure } from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';

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

Update- downgrading to Enzyme 3.10.0 seems to have fixed this. Curious if it's my setup or a widespread issue.

Given that this package has been downloaded 8.1 million times already I think I would have known about this if it was widespread.

My best guess is that you may have had multiple versions of Enzyme installed, and as the result the Enzyme @wojtekmaj/enzyme-adapter-react-17 inherited from was not the same one that checked the inheritance, causing said error.

Fair enough, I caught the issue here as well and verified that I only had one version of Enzyme in the package-lock, but I don't doubt it's something I'm doing. Thanks for the quick response 👍

I'll be happy to help out if you need, but I'll need a repro repo to work with.