Search code examples
react-nativejestjsjasmine

Cannot find module 'expect/build/jasmineUtils'


Trying to execute a test suite, I found this error, that reinstalling all the jest-related dependencies doesn't fix it.

Test suite failed to run

    Cannot find module 'expect/build/jasmineUtils' from 'node_modules/jest-extended/dist/utils/index.js'

    Require stack:
      node_modules/jest-extended/dist/utils/index.js
      node_modules/jest-extended/dist/matchers/toBeArrayOfSize/index.js
      node_modules/jest-extended/dist/matchers/index.js
      node_modules/jest-extended/dist/index.js

      at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:425:11)
      at Object.<anonymous> (node_modules/jest-extended/dist/utils/index.js:8:21)
      at Object.<anonymous> (node_modules/jest-extended/dist/matchers/toBeArrayOfSize/index.js:9:14)
      at Object.<anonymous> (node_modules/jest-extended/dist/matchers/index.js:17:15)
      at Object.<anonymous> (node_modules/jest-extended/dist/index.js:3:17)

Could be related with it, seems similar: https://github.com/just-jeb/jest-marbles/issues/184


Solution

  • Afterward, all were related to some problem that jest have dealing with promises in the last versions. Babel problems with the last version of Jest updating ReactNative