Jest: Error: Cannot find module 'ErrorUtils' from 'env.js'

Created on 6 May 2016  路  5Comments  路  Source: facebook/jest

React-native v0.24, jest v12

 FAIL  src/foo-test.js
Runtime Error
Error: Cannot find module 'ErrorUtils' from 'env.js'
    at Runtime._resolveNodeModule (/foo-project/node_modules/jest-cli/src/Runtime/Runtime.js:451:11)
    at Object.<anonymous> (/foo-project/node_modules/react-native/jestSupport/env.js:22:28)

The error is from this line:

jest.setMock('ErrorUtils', require('ErrorUtils'));

Introduced by this commit in react-native: https://github.com/facebook/react-native/commit/b84ad2ab0da26d8285986a4519b2d824f520ce65

All 5 comments

1+

Can you try adding this: https://github.com/fbsamples/f8app/blob/master/package.json#L51-L60 to your Jest config? That should work.

The docs in react-native about Jest testing are unfortunately entirely outdated and no one is bothering to update them :(

Closing as duplicate of #921.

Is this a yubikey?

which one version suites for that?
@cpojer

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paularmstrong picture paularmstrong  路  3Comments

kgowru picture kgowru  路  3Comments

StephanBijzitter picture StephanBijzitter  路  3Comments

ianp picture ianp  路  3Comments

hramos picture hramos  路  3Comments