Skip to content

Jest failed after upgrade to react-native 0.64 #703

Closed
@McSam94

Description

@McSam94

Describe the bug

Recently I upgraded my project to 0.64 version and faced this issue when I run jest. The same error happened even after I tried with a fresh react-native project with package react-navigation.

type ErrorHandler = (error: mixed, isFatal: boolean) => void;
         ^^^^^^^^^^^^

SyntaxError: Unexpected identifier

  at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
  at Object.<anonymous> (node_modules/react-native/jest/setup.js:439:6)

Expected behavior

Jest should be completed without error.

Steps to Reproduce

  1. react-native init
  2. install all the react-navigation packages
  3. set up the testing environment as documented. (https://callstack.github.io/react-native-testing-library/docs/react-navigation#setting-up-the-test-environment)
  4. run jest

Screenshots

Screenshot 2021-03-19 at 8 29 48 PM

Versions

Screenshot 2021-03-19 at 8 30 20 PM

Please help. Thanks in advance 🙏🏿

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions