forked from wix/react-native-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-unit.js
48 lines (40 loc) · 1.39 KB
/
test-unit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const _ = require('lodash');
const exec = require('shell-utils').exec;
const android = _.includes(process.argv, '--android');
const release = _.includes(process.argv, '--release');
function run() {
if (android) {
runAndroidUnitTests();
} else {
runIosUnitTests();
}
}
function runAndroidUnitTests() {
const conf = release ? 'testReactNative57_5ReleaseUnitTest' : 'testReactNative57_5DebugUnitTest';
exec.execSync(`cd lib/android && ./gradlew ${conf}`);
}
function runIosUnitTests() {
const conf = release ? `Release` : `Debug`;
exec.execSync(`cd ./playground/ios &&
RCT_NO_LAUNCH_PACKAGER=true
xcodebuild build build-for-testing
-scheme "ReactNativeNavigation"
-project playground.xcodeproj
-sdk iphonesimulator
-configuration ${conf}
-derivedDataPath ./DerivedData/playground
-quiet
-UseModernBuildSystem=NO
ONLY_ACTIVE_ARCH=YES`);
exec.execSync(`cd ./playground/ios &&
RCT_NO_LAUNCH_PACKAGER=true
xcodebuild test-without-building
-scheme "ReactNativeNavigation"
-project playground.xcodeproj
-sdk iphonesimulator
-configuration ${conf}
-destination 'platform=iOS Simulator,name=iPhone X'
-derivedDataPath ./DerivedData/playground
ONLY_ACTIVE_ARCH=YES`);
}
run();