react-native-navigation的迁移库

123456789101112131415161718192021222324252627282930
  1. const includes = require('lodash/includes');
  2. const exec = require('shell-utils').exec;
  3. const android = includes(process.argv, '--android');
  4. const release = includes(process.argv, '--release');
  5. const skipBuild = includes(process.argv, '--skipBuild');
  6. const headless = includes(process.argv, '--headless');
  7. const multi = includes(process.argv, '--multi');
  8. const verbose = includes(process.argv, '--verbose');
  9. run();
  10. function run() {
  11. const prefix = android ? `android.emu` : `ios.sim`;
  12. const suffix = release ? `release` : `debug`;
  13. const configuration = `${prefix}.${suffix}`;
  14. const headless$ = android ? headless ? `--headless` : `` : ``;
  15. const workers = multi ? 3 : 1;
  16. const loglevel = verbose ? '--loglevel verbose' : '';
  17. if (!android) {
  18. exec.execSync('npm run build');
  19. exec.execSync('npm run pod-install');
  20. }
  21. if (!skipBuild) {
  22. exec.execSync(`detox build --configuration ${configuration}`);
  23. }
  24. exec.execSync(`detox test --configuration ${configuration} ${headless$} -w ${workers} ${loglevel}`); //-f "ScreenStyle.test.js" --loglevel trace
  25. }