Skip to content
This repository was archived by the owner on Mar 25, 2022. It is now read-only.
This repository was archived by the owner on Mar 25, 2022. It is now read-only.

ReferenceError: __DEV__ is not defined #5

@jrm2k6

Description

@jrm2k6

I am trying to unit tests some of my RN components with ava.

I have the following in my package.json:

"babel": {
    "presets": ["react-native", "es2015"],
    "plugins": ["react-native-config-node/transform"],
    "ignore": false
  },
  "ava": {
    "babel": "inherit",
    "files": [
      "app/__tests__/*",
      "!app/__tests__/testHelper.js"
    ],
    "require": [
      "babel-register",
      "babel-polyfill"
    ],
    "source": [
      "app/*"
    ]
  }

When I try to run my tests, I got an error with the following stacktrace:

/Users/jrm2k6/Workspace/local.dev/my-companion/node_modules/react-native/Libraries/react-native/react-native.js:15
if (__DEV__) {
    ^

ReferenceError: __DEV__ is not defined

I have another project using this package in combination with react-native-config, but using mocha instead of ava, and just pulling this package worked. I have pretty much the same config in there. Any idea how I could fix that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions