Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1085
Closed
Open
Issue created Nov 22, 2016 by Administrator@rootContributor

Tests fail in a react-native-web app with __DEV__ is not defined

Created by: tlvince

In a fresh app created by create-react-app using React Native for Web, running src/root/Root.test.js throws ReferenceError: __DEV__ is not defined.

I would assume an equivalent of #407 (aliasing react-native to react-native-web) is necessary in the test environment. If I temporarily manually symlink react-native-web to react-native in node_modules and re-run the tests, they pass as expected.

Expected behavior

Tests to pass.

Actual behaviour

 FAIL  src/root/Root.test.js
  ● Test suite failed to run

    ReferenceError: __DEV__ is not defined
      
      at Object.<anonymous> (node_modules/react-native/Libraries/react-native/react-native.js:15:5)
      at Object.<anonymous> (src/app/App.js:3:18)
      at Object.<anonymous> (src/root/Root.js:3:10)
      at Object.<anonymous> (src/root/Root.test.js:5:11)
      at process._tickCallback (internal/process/next_tick.js:103:7)

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected): 0.7.0
  2. node -v: 6.9.1
  3. npm -v: 3.10.9

Then, specify:

  1. Operating system: OS X 10.10.5
  2. Browser and version: Chrome v53
Assignee
Assign to
Time tracking