From ac30f64ae573903570878b467ae14c85e793a451 Mon Sep 17 00:00:00 2001 From: Josh Justice Date: Fri, 14 Dec 2018 12:42:52 -0800 Subject: [PATCH] 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 --- RNTester/e2e/config.json | 2 +- RNTester/js/RNTesterApp.ios.js | 7 +++++++ package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RNTester/e2e/config.json b/RNTester/e2e/config.json index 1c8ffa442e8dd4..e2b92bc913e4e8 100644 --- a/RNTester/e2e/config.json +++ b/RNTester/e2e/config.json @@ -1,5 +1,5 @@ { - "setupTestFrameworkScriptFile" : "./test-init.js", + "setupFilesAfterEnv" : ["./test-init.js"], "testEnvironment": "node", "bail": true, "verbose": true diff --git a/RNTester/js/RNTesterApp.ios.js b/RNTester/js/RNTesterApp.ios.js index 10577f5694b679..56a90d435bac2e 100644 --- a/RNTester/js/RNTesterApp.ios.js +++ b/RNTester/js/RNTesterApp.ios.js @@ -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}) => ( diff --git a/package.json b/package.json index 4e194cd3a33e04..1bd7c0d7bc6226 100644 --- a/package.json +++ b/package.json @@ -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"