jest-wrap icon indicating copy to clipboard operation
jest-wrap copied to clipboard

jest-wrap is breaking Enzyme post React 16.4

Open culshaw opened this issue 5 years ago • 1 comments

Hello, me again.

I have done some investigation this morning around how our tests started failing after updating from React 16.4 to 16.6 (then 16.8) but have found that the cause is jest-wrap when you use mount from Enzyme.

Here's a sample repository highlighting what we're experiencing. https://github.com/culshaw/jest-wrap-react-16.8

There are two test files, one with no wrapping which contain identical tests as tests that are wrapped, mocking an object called YJ and the other mocking the entire window and YJ.

Hope it helps!

culshaw avatar May 17 '19 09:05 culshaw

Thanks for the report - I'll try to take a look soon.

I'm confused how react 16.4 would work, but 16.5 (presumably) would fail - with enzyme, the code wouldn't change, except to enable a few new features.

ljharb avatar May 25 '19 20:05 ljharb