brunolemos/react-native-web-monorepo

Tests wont run

thorakmedichi opened this issue · 2 comments

I cloned your repo and all works great. Thanks you.

The one exception is the tests will not pass. I keep getting the following

❯ yarn workspace mobile test

yarn workspace v1.17.3
yarn run v1.17.3

$ jest
 FAIL  __tests__/App-test.js
  ● Test suite failed to run

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

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

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.176s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /home/thorakmedichi/.nvm/versions/node/v11.15.0/bin/node
Arguments: /usr/share/yarn/lib/cli.js test
Directory: /home/thorakmedichi/Development/Projects/stormfree/react-native-web-monorepo/packages/mobile
Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.

I am not sure what to do. I have spent a couple hours now combing the google-verse and non of the suggestions seem to make a difference at all.

@thorakmedichi i would recommend creating a project using react-native and check which dependencies are being used. This seems the best solution to make your project work as expected. I upgraded some dependencies and the project seems to work. However, react native tests with jest require the component to use default export. In my case it worked just fine 🎉

Having the default export didn't help in my case. Any other suggestions?