You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
npm ls react-scripts (if you haven’t ejected): 0.7.0
node -v: 6.9.1
npm -v: 3.10.9
Then, specify:
Operating system: OS X 10.10.5
Browser and version: Chrome v53
The text was updated successfully, but these errors were encountered:
I've just stumbled that issue with similar circumstances; running tests in a CRA app while RNW is in use. @gaearon's suggestion works perfectly. Here is a pull request that includes the change #1201.
In a fresh app created by create-react-app using React Native for Web, running
src/root/Root.test.js
throwsReferenceError: __DEV__ is not defined
.I would assume an equivalent of #407 (aliasing
react-native
toreact-native-web
) is necessary in the test environment. If I temporarily manually symlinkreact-native-web
toreact-native
innode_modules
and re-run the tests, they pass as expected.Expected behavior
Tests to pass.
Actual behaviour
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): 0.7.0node -v
: 6.9.1npm -v
: 3.10.9Then, specify:
The text was updated successfully, but these errors were encountered: