-
Notifications
You must be signed in to change notification settings - Fork 24.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests failing on a newly created app #15810
Comments
I dropped back to version |
@shaundon I just have migrated to the latest version. Tests passed on |
Also this issue reproducible on node |
I have the same tool versions in my stack. |
I created PR in #15843 to fix this issue. |
Tests are failing, see facebook/react-native#15810
Summary: React Native v0.48.0 shipped `WebSocketModule` support with `BlobModule` as dependency. But `BlobModule` is not mocked in jest which will cause render tests failed. Reference implantation: [BlobModule.java](https://github.com/facebook/react-native/blob/ed903099b42259958d8a6eb3af1a6460c1bc8b2c/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java) Related PR: #11417 Related issue: #15810 Passed CI tests. Need render a component in jest with WebSocketModule as dependency. Closes #15843 Differential Revision: D5783263 Pulled By: shergin fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
Summary: React Native v0.48.0 shipped `WebSocketModule` support with `BlobModule` as dependency. But `BlobModule` is not mocked in jest which will cause render tests failed. Reference implantation: [BlobModule.java](https://github.com/facebook/react-native/blob/ed903099b42259958d8a6eb3af1a6460c1bc8b2c/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java) Related PR: facebook#11417 Related issue: facebook#15810 Passed CI tests. Need render a component in jest with WebSocketModule as dependency. Closes facebook#15843 Differential Revision: D5783263 Pulled By: shergin fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
Thanks to @timwangdev's PR, here are some temp workarounds that don't involve downgrading Node, until a release is cut with @timwangdev's fix. WORKAROUND 1: WORKAROUND 2: Install RN #master git branch:
|
Another workaround does not involve change current RN files (I'm using) is: Add https://github.com/facebook/react-native/blob/master/jest/setup.js#L112-L307 to your own project's jest-setup.js. This one will actually rewrite the mock for whole You could remove those lines after the fix releases. |
Requires to patch tests/setup.js, see facebook/react-native#15810
Summary: React Native v0.48.0 shipped `WebSocketModule` support with `BlobModule` as dependency. But `BlobModule` is not mocked in jest which will cause render tests failed. Reference implantation: [BlobModule.java](https://github.com/facebook/react-native/blob/ed903099b42259958d8a6eb3af1a6460c1bc8b2c/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java) Related PR: facebook#11417 Related issue: facebook#15810 Passed CI tests. Need render a component in jest with WebSocketModule as dependency. Closes facebook#15843 Differential Revision: D5783263 Pulled By: shergin fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
Summary: React Native v0.48.0 shipped `WebSocketModule` support with `BlobModule` as dependency. But `BlobModule` is not mocked in jest which will cause render tests failed. Reference implantation: [BlobModule.java](https://github.com/facebook/react-native/blob/ed903099b42259958d8a6eb3af1a6460c1bc8b2c/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java) Related PR: #11417 Related issue: #15810 Passed CI tests. Need render a component in jest with WebSocketModule as dependency. Closes #15843 Differential Revision: D5783263 Pulled By: shergin fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
Summary: React Native v0.48.0 shipped `WebSocketModule` support with `BlobModule` as dependency. But `BlobModule` is not mocked in jest which will cause render tests failed. Reference implantation: [BlobModule.java](https://github.com/facebook/react-native/blob/ed903099b42259958d8a6eb3af1a6460c1bc8b2c/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java) Related PR: #11417 Related issue: #15810 Passed CI tests. Need render a component in jest with WebSocketModule as dependency. Closes #15843 Differential Revision: D5783263 Pulled By: shergin fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
Jest is failing to run in NavigationPlayground because of this issue. This is my attempt to fix it, which unfortunately did not work locally...
For anybody still experiencing this issue, note that it is fixed in 0.48.4. It can be closed now. |
* Fix .flowconfig to stop ignoring modules and properly include React Native libraries Currently, there are numerous ignored libraries that are hiding type errors. Actually, they're causing type errors too. This sort of thing only patches over actual problems, so we have to revert them to get a config we can build upon. * Update react-native/flow-bin dependencies We want to have Flow types working with the latest packages. * Update flow-typed libraries (auto-generated) * Fix typing of navigation prop used by withNavigation HOC The current typing is clearly a typo, as it is circular. `NavigationScreenProp` should be used to type the navigation prop * Fix typing of easing function What's funny is that I fixed this before in d71ed75. @skevy reintroduced the mistyped function in 9436d03, which didn't trigger any Flow errors because .flowconfig was ignoring the entire react-native package * Correct typing of View and Text style prop The current code thinks it can import these, but this isn't true, and was being hidden because the .flowconfig ignored the whole react-native package. There's no easy to type Text and View at the current moment, as far as I can tell. Importing the highly generic `StyleObj` seems like the best bet, and is what I have being using in my projects. * Import NavigationScreenComponent using full path * Updating yarn.lock files * Get rid of library overrides in flow-typed/react-native.js and flow/react-navigation.js * Add @flow to src/react-navigation.js and make last three params to createNavigator optional * Make screenProps and navigationOptions optional in NavigationNavigatorProps * yarn run format * Readd react-navigation/node_modules ignore to NavigationPlayground's .flowconfig Realized this line I removed in the first commit is necessary when using npm link/yarn link, which is what the CircleCI build does * Make all DrawerViewConfig's params optional Some of these params are marked as optional because they have defaults. However, the only place `DrawerViewConfig` is used is as the input the function that then applies the defaults * Make all props in NavigationNavigatorProps optional `NavigationNavigatorProps` is used to type the props of the component that is output by the `StackNavigator`, `TabNavigator`, etc. component factories. This component does not need to have any props specified. * Make second param to `DrawerNavigator` factory optional `DrawerNavigator`, just like `TabNavigator` and `StackNavigator`, can be called with just a single argument (ie. omitting the config) * Upgrade to RN 0.48.4 to address facebook/react-native#15810
@facebook-github-bot close |
FAIL tests/App.js
FAIL tests/App-test.js
Test Suites: 2 failed, 2 total tried by various ways but could not found exact solution, even dont know the exact problem. |
Is this a bug report?
yes
Have you read the Contributing Guidelines?
yes
Environment
react-native-cli: 2.0.1
react-native: 0.48.1
node: v8.4.0
yarn: 0.27.5
iOs, Android
macOs Sierra 10.12.6
Steps to Reproduce
Expected Behavior
Initially created tests should pass.
Actual Behavior
The text was updated successfully, but these errors were encountered: