From 7bc95aba4a30623d0fe3491e878c398d6b818293 Mon Sep 17 00:00:00 2001 From: danielel Date: Thu, 18 May 2023 12:13:57 +0300 Subject: [PATCH] fix-ios-test --- scripts/test-unit.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/test-unit.js b/scripts/test-unit.js index 83be3ee86..127a428fc 100644 --- a/scripts/test-unit.js +++ b/scripts/test-unit.js @@ -23,29 +23,35 @@ function runAndroidUnitTests() { } function runIosUnitTests() { - const conf = release ? `Release` : `Debug`; + exec.execSync('npm run build'); exec.execSync('npm run pod-install'); + testTarget('NotificationsExampleApp', 'iPhone 11', '13.7'); + // testTarget('NotificationsExampleAppIOS12', 'iPhone X', '12.4'); +} + +function testTarget(scheme, device, OS = 'latest') { + const conf = release ? `Release` : `Debug`; exec.execSync(`cd ./example/ios && RCT_NO_LAUNCH_PACKAGER=true xcodebuild build build-for-testing - -scheme "NotificationsExampleApp" + -scheme "${scheme}" -workspace NotificationsExampleApp.xcworkspace -sdk iphonesimulator -configuration ${conf} - -derivedDataPath ./example/ios/DerivedData/NotificationsExampleApp + -derivedDataPath ./DerivedData/NotificationsExampleApp -quiet - -UseModernBuildSystem=NO + -UseModernBuildSystem=YES ONLY_ACTIVE_ARCH=YES`); exec.execSync(`cd ./example/ios && RCT_NO_LAUNCH_PACKAGER=true xcodebuild test-without-building - -scheme "NotificationsExampleApp" + -scheme "${scheme}" -workspace NotificationsExampleApp.xcworkspace -sdk iphonesimulator -configuration ${conf} - -destination 'platform=iOS Simulator,name=iPhone 11' - -derivedDataPath ./example/ios/DerivedData/NotificationsExampleApp + -destination 'platform=iOS Simulator,name=${device},OS=${OS}' + -derivedDataPath ./DerivedData/NotificationsExampleApp ONLY_ACTIVE_ARCH=YES`); }