Skip to content
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

Testing w/ inferno-compat #1174

Closed
unsafecode opened this issue Jul 23, 2017 · 3 comments
Closed

Testing w/ inferno-compat #1174

unsafecode opened this issue Jul 23, 2017 · 3 comments

Comments

@unsafecode
Copy link

Issue Template

Observed Behaviour

When testing components that reference react-based components (like react-bootstrap ones), Jest reports Cannot find module 'react' from <whatever>. It looks like inferno-compat is not taken into account when testing.

Additionally, trying to patch Jest configuration in package.json like described for Preact (preactjs/preact#560) yields the following error:

image.

Therefore, I'd say it is not possible to test any react-based component today, unless ejecting from the standard config - which is, IMHO, quite disappointing for such a common scenario.

Expected Current Behaviour

Inferno-compat should support testing as well.

Inferno Metadata

Windows 10 v1703
Node@8.1.4
npm@5.3.0
inferno@3.7.0

@LukeSheard
Copy link
Contributor

I assume here that you're using create-inferno-app, in which case it's probably an issue with the jest.config.js file which doesn't take into account the web pack alias which are setup. This probably belongs there but you could checkout the create-inferno-app repo or if you can modify the jest config try alias the modules there.

@unsafecode
Copy link
Author

@LukeSheard Exactly, I'm using create-inferno-app. Will look into that.

@LukeSheard
Copy link
Contributor

LukeSheard commented Jul 24, 2017

Closing this now due to the other open issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants