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

Cannot find module 'setupDevtools' from 'setup.js' #879

Closed
Nightsd01 opened this issue Nov 19, 2018 · 5 comments
Closed

Cannot find module 'setupDevtools' from 'setup.js' #879

Nightsd01 opened this issue Nov 19, 2018 · 5 comments

Comments

@Nightsd01
Copy link

Nightsd01 commented Nov 19, 2018

Issue :

I'm developing a react-native SDK. Whenever I attempt to run my tests using npx jest, I see the following error:

 FAIL  src/__tests__/onesignal.test.ts
  ● Test suite failed to run

    Cannot find module 'setupDevtools' from 'setup.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
      at Object.<anonymous> (node_modules/react-native/jest/setup.js:12:6)

Expected behavior :

I'm not a JS developer (I'm an iOS dev) so forgive my complete ignorance. I am not sure if this is an issue with ts-jest or not.

Debug log:

I set the environmental variable, but ts-jest.log is no where to be found?

Minimal repo:

Here is our SDK: https://github.com/geektimecoil/react-native-onesignal/tree/typescript_conversion

I am working in the typescript_conversion branch, that is where the issue is.

@raven-chen
Copy link

Same issue here. still investigating it..

@ahnpnl
Copy link
Collaborator

ahnpnl commented Nov 25, 2018

I see a similar issue reported in react-native github. I think it might not be related to ts-jest

@Nightsd01
Copy link
Author

I think you are right - I'll be closing this issue since it probably is an issue with jest and not this repo.

@bySabi
Copy link

bySabi commented Nov 27, 2018

Same here @Nightsd01 do you solved it?

@adrian-moisa
Copy link

Several bugfixes were needed, and I managed to get the tests running:

  • Eliminates unknown "export" token: "Unexpected token export, when import not compiled libraries"
"transformIgnorePatterns": [
    "node_modules/?!(react-router)"
],
  • Removed jsdom - no longer emulating browser environment for react native. "TypeError: Cannot set property '_eventListeners' of undefined” with jest"
  • Updated: testPathIgnorePatterns to ignore all folders except "src" so we can remove roots: ["src"] which causes: "Cannot find module 'setupDevtools' from 'setup.js'"

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

5 participants