-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chai-enzyme can not work with enzyme 3.0 and react 16.0.0 #199
Comments
@ljharb Thanks for your reply. 👍 |
Having the same issue. |
same error, please fix this. |
@ljharb I looked at the two related issues you stated but don't see what I should be doing here...are we waiting for a PR for a fix? OR is there a workaround for the time being? Wasn't sure if you worked on this project or if it's solely supported by airbnb but thought you'd know :). |
Yes, we're waiting on a PR; it's not solely supported by airbnb; and there's no workaround for the time being (besides "stay on enzyme 2" or "don't use chai-enzyme until it's ready") |
thanks @ljharb |
Will try to release a beta 1.0.0 release tomorrow with support for enzyme 3 (& thus react 16). Once things look stable (I'll test the library against the Product Hunt test suite) will release the 1.0.0 |
Just released the new version as a beta, to try it out yarn add chai-enzyme@beta |
I'm seeing quite some failing tests in my test suite with the following message:
With the following stacktrace:
Is this also the case for others? |
can you relax the |
Certainly the peer dep here should match enzyme's. A PR would be great. |
Is the Invarient Violation error resolved? I am still seeing it in my tests, when I do the following assertion.
|
@ljharb I tried chai-enzyme@beta this morning, our project contains 600 unit tests(include 257 react compont tests, others are action, store, validation tests), all tests work correctly. For the security policy reason, I can't attach the screenshot. |
@ljharb @linchen2chris we're running on chai-enzyme@beta now too, there were only a couple necessary changes needed in our codebase - wrapper.find('[data-test="save-topics"]').simulate('click');
+ wrapper
+ .find('[data-test="save-topics"]')
+ .first()
+ .simulate('click'); - const input = wrapper.find('input').get(0);
+ const input = wrapper.instance().input; |
@ayrton we‘re lucky, the apis we used didn't change. 😀 |
After migration to enzyme I catch the error when start testing, also I use chai 4.1.2 and chay-enzyme "^1.0.0-beta.0" with React 16,
all my casse failed on should.be.deep.equal
|
@palaniichukdmytro does it pass on enzyme 3 and react 15? Regardless; it looks like the issue is that you’re not using jsdom. |
@ljharb no I use enzyme 3.x and react 16, I use jsdom, with old/api, also there is still issue with HTMLElement is not defined, I've already solved it, but not quite understand why it happend, |
If you use jsdom, all the browser globals will be provided; you don't want to have to provide them all one at a time manually. |
it will give error cannot find module 'enzyme/build/react-compat.js'
The text was updated successfully, but these errors were encountered: