Skip to content

Jest fails to run tests on React Native 0.59.5 #24447

Closed
@ethanneff

Description

@ethanneff

🐛 Bug Report

Jest fails to run on React Native 0.59.5

To Reproduce

  1. update react native 0.59.3 -> 0.59.5
  2. have jest config:
  "jest": {
    "preset": "react-native",
    "transform": {
      "^.+\\.(jsx?)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js",
      "^.+\\.tsx?$": "ts-jest"
    },
    "transformIgnorePatterns": [
      "node_modules/(?!react-native)/"
    ],
    "globals": {
      "window": {},
      "ts-jest": {
        "tsConfig": "./tsconfig.jest.json"
      }
    }
  },
  1. run jest ./node_modules/.bin/jest
  2. get the following error
$ ./node_modules/.bin/jest
No tests found
In /Users/ethanneff/Dropbox/active/dev/react-native/example
  712 files checked.
  testMatch:  - 712 matches
  testPathIgnorePatterns: /node_modules/ - 190 matches
  testRegex: (/__tests__/.*|(\.|/)(test|spec))\.(jsx?|tsx?)$ - 2 matches
Pattern:  - 0 matches

Expected Behavior

Jest was working fine and running all tests in 0.59.3

Code Example

See steps to reproduce

Environment

$ react-native info
info 
  React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 534.38 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.7.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 22, 23, 24, 25, 26, 27, 28
        Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3
        System Images: android-19 | Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5314842
      Xcode: 10.2/10E125 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.6 => 16.8.6 
      react-native: 0.59.4 => 0.59.4 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions