Fix E2E warnings (#22621)

Summary:
Fixes two types of warnings that occur when running E2E tests:

1. A deprecation warning from Jest: 'Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.'
2. YellowBox warnings when running the app in debug mode, about components that are deprecated and that require main queue setup.

By fixing these warnings, we increase contributors' confidence that things are working correctly, and draw attention to any warnings that they _should_ pay attention to, if and when they arise.

I feel confident that we should hide the deprecated-component warnings; we _want_ to use these components because we want them to be tested, until they're removed entirely.

For the warning "Module RCTImagePickerManager requires main queue setup", if that's something that can be fixed with reasonable effort in the RNTester code then I think it would be better to do so. Otherwise, I think it is good to hide the warning, because this is a condition we expect: it's not something a contributor should pay attention to.
Pull Request resolved: https://github.com/facebook/react-native/pull/22621

Differential Revision: D13468553

Pulled By: hramos

fbshipit-source-id: 1a5952087dd6fcc9ba08ff7a60ad9f5b075bef57
This commit is contained in:
Josh Justice 2018-12-14 12:42:52 -08:00 committed by Facebook Github Bot
parent 0eeb94e948
commit ac30f64ae5
3 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,5 @@
{
"setupTestFrameworkScriptFile" : "./test-init.js",
"setupFilesAfterEnv" : ["./test-init.js"],
"testEnvironment": "node",
"bail": true,
"verbose": true

View File

@ -30,6 +30,7 @@ const {
Text,
View,
SafeAreaView,
YellowBox,
} = ReactNative;
import type {RNTesterExample} from './RNTesterList.ios';
@ -40,6 +41,12 @@ type Props = {
exampleFromAppetizeParams: string,
};
YellowBox.ignoreWarnings([
'ListView and SwipeableListView are deprecated',
'ListView is deprecated',
'Module RCTImagePickerManager requires main queue setup',
]);
const APP_STATE_KEY = 'RNTesterAppState.v2';
const Header = ({onBack, title}: {onBack?: () => mixed, title: string}) => (

View File

@ -147,7 +147,7 @@
"test-android-unit": "yarn run docker-build-android && yarn run test-android-run-unit",
"test-android-e2e": "yarn run docker-build-android && yarn run test-android-run-e2e",
"build-ios-e2e": "detox build -c ios.sim.release",
"test-ios-e2e": "detox test -c ios.sim.release --cleanup"
"test-ios-e2e": "detox test -c ios.sim.release"
},
"peerDependencies": {
"react": "16.6.3"