Inferno: enzyme-compat?

Created on 26 Feb 2017  Â·  16Comments  Â·  Source: infernojs/inferno

I know that enzyme is not compatible with Inferno and that there is an issue where there are discussions to support other JSX libraries too: https://github.com/airbnb/enzyme/issues/715

Today I found preact-compat-enzyme that would enable this for preact. Is it worth it to look deeper into it an try to adopt it to Inferno?

feature request help wanted question

Most helpful comment

I have the basics working. I’m on holiday for the next week. But should have something reasonably soon to show.

All misspelling thanks to my iPhone.


From: Antonin Adert notifications@github.com
Sent: Thursday, September 21, 2017 6:24:44 PM
To: infernojs/inferno
Cc: garren smith; Mention
Subject: Re: [infernojs/inferno] enzyme-compat? (#892)

I'm a noob on Inferno but I will mentally support @garrensmithhttps://github.com/garrensmith . Isn't there any core Inferno dev to support this ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/infernojs/inferno/issues/892#issuecomment-331209291, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAK9AqsDiGMvJz0x-8QWpofomh_7FyaVks5sko3MgaJpZM4MMdtz.

All 16 comments

@screendriver would you be interested in porting preact-compat-enzyme to Inferno? That would be awesome :)

If I had enough time for it I would definitely do that 😭

Enzyme support has been requested couple of times in slack, it would be nice if somebody could start working on this.

I would be happy to start working on this. We need this for https://github.com/apache/couchdb-fauxton, since we are moving away from React. I'm new to inferno.js. So any suggestions/pointers on how to get started would be awesome and I can then take a stab at this

Based off of this https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js it seems i can just follow how those are done as a starting point.

I'm a noob on Inferno but I will mentally support @garrensmith . Isn't there any core Inferno dev to support this ?

I have the basics working. I’m on holiday for the next week. But should have something reasonably soon to show.

All misspelling thanks to my iPhone.


From: Antonin Adert notifications@github.com
Sent: Thursday, September 21, 2017 6:24:44 PM
To: infernojs/inferno
Cc: garren smith; Mention
Subject: Re: [infernojs/inferno] enzyme-compat? (#892)

I'm a noob on Inferno but I will mentally support @garrensmithhttps://github.com/garrensmith . Isn't there any core Inferno dev to support this ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/infernojs/inferno/issues/892#issuecomment-331209291, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAK9AqsDiGMvJz0x-8QWpofomh_7FyaVks5sko3MgaJpZM4MMdtz.

I'm going to give this a go today.@garrensmith are you still working on it? Have you got any advice?

I made some good progress but I haven’t had time to get back to it. I think the best way to do this would be to fork the React 16 adapter and use that as the starting point.

All misspelling thanks to my iPhone.


From: Edd Yerburgh notifications@github.com
Sent: Friday, October 13, 2017 7:34:18 AM
To: infernojs/inferno
Cc: garren smith; Mention
Subject: Re: [infernojs/inferno] enzyme-compat? (#892)

I'm going to give this a go today.@garrensmithhttps://github.com/garrensmith are you still working on it? Have you got any advice?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/infernojs/inferno/issues/892#issuecomment-336354805, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAK9AnBiyrRb-FVXXECzXHC2wcWq0vCgks5srvZagaJpZM4MMdtz.

Sorry I'm not able to complete the work on this. I was initially working on this because we couldn't use React with Apache CouchDB. But now we can. So unfortunately I just don't have the time to continue this work. I got the basic concepts working and am happy to help anyone if I can. But unfortunately to avoid opensource burnout I just can't work on this. I'm very sorry.

Ok that's fine, I got find and simulate working. I'll publish it soon

@eddyerburgh any chance we could see what you got?

@cannuk I've been working on it as part of 10% at work and I'm waiting for legal to give the OK to make it public. As soon as It's public I'll post it here.

It's not functional at the moment, my early success with find and simulate were hacks that mean the rest of the enzyme methods didn't work.

It's public 😀 — https://github.com/bbc/inferno-enzyme-adapter

I copied tests over from Enzyme. 245/287 are passing.

The find, simulate, and setState tests are all passing. All other main methods are passing, there are just a few edge cases that are failing, like using arrays in contains

context hasn't been implemented at all, and is responsible for most of the failing tests.

I'm going to release on npm this week

I've published 0.1.0 on npm.

npm install --save-dev enzyme-adapter-inferno

@eddyerburgh Can you send PR to add that package to Inferno's Readme / websites (https://github.com/infernojs/inferno-website)? Lets close this issue :)
Good job!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gajus picture gajus  Â·  3Comments

EmilTholin picture EmilTholin  Â·  5Comments

alexichepura picture alexichepura  Â·  5Comments

brenr picture brenr  Â·  3Comments

Havunen picture Havunen  Â·  3Comments