forked from wix/react-native-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-e2e.js
32 lines (28 loc) · 1.06 KB
/
test-e2e.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
const includes = require('lodash/includes');
const exec = require('shell-utils').exec;
const android = includes(process.argv, '--android');
const release = includes(process.argv, '--release');
const skipBuild = includes(process.argv, '--skipBuild');
const headless = includes(process.argv, '--headless');
const multi = includes(process.argv, '--multi');
const verbose = includes(process.argv, '--verbose');
run();
function run() {
const prefix = android ? `android.emu` : `ios.sim`;
const suffix = release ? `release` : `debug`;
const configuration = `${prefix}.${suffix}`;
const headless$ = android ? (headless ? `--headless` : ``) : ``;
const workers = multi ? 3 : 1;
const loglevel = verbose ? '--loglevel verbose' : '';
if (!android) {
exec.execSync('npm run build');
exec.execSync('npm run pod-install');
}
if (!skipBuild) {
exec.execSync(`detox build --configuration ${configuration}`);
}
exec.execSync(
`detox test --configuration ${configuration} ${headless$} -w ${workers} ${loglevel}`
// "Buttons.test.js" --loglevel trace`
);
}