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

Jest tests fail with "module not found" #11

Open
o-faro opened this issue Mar 9, 2021 · 4 comments
Open

Jest tests fail with "module not found" #11

o-faro opened this issue Mar 9, 2021 · 4 comments

Comments

@o-faro
Copy link
Contributor

o-faro commented Mar 9, 2021

Hi,
trying to run tests with jest fails with

Test suite failed to run
Cannot find module 'react-icon-system' from 'src/.../index.tsx'
...
> 6 | import Icon from "react-icon-system";
...
      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (src/.../index.tsx:6:1)
...
Test Suites: 1 failed, 1 total

I am working on a large project and there seems to be no problem with other node modules. Is it correctly exported as a module? Did not have time to look into this more closer.

Appreciate any help on this one! @Kosai106

@Kosai106
Copy link
Owner

I am very sorry, I missed your message.

I'll have a look ASAP and get back to you.

@Kosai106
Copy link
Owner

Sorry for the delay here @o-faro but I am having trouble reproducing the error. Could you create a repo for me where the issue is occurring?

@o-faro
Copy link
Contributor Author

o-faro commented Apr 6, 2021

Hi @Kosai106
sorry for the delay as well, to much todo before holidays.. I created a very simple example for this, just have a look at https://github.com/o-faro/icon-system-test
Install and run the test.
Test setup is much more simplier as in the project the problem first appeared. I just used the enviroment comming with rca. Importing the module causes the error.

@Kosai106
Copy link
Owner

Kosai106 commented Apr 6, 2021

No worries, I understand.

Thanks for providing a reproductive repo, that really helps!
I've gone ahead and released a new version 1.3.0 which fixes the issue with the module not being found.

That being said, it ends up causing a new issue TypeError: require.context is not a function which I've yet to find a suitable solution for.

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

No branches or pull requests

2 participants