react-native-navigation的迁移库

test-e2e.js 866B

123456789101112131415161718192021222324
  1. const _ = require('lodash');
  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. run();
  8. function run() {
  9. const platform = android ? `android` : `ios`;
  10. const prefix = android ? `android.emu` : `ios.sim`;
  11. const suffix = release ? `release` : `debug`;
  12. const configuration = `${prefix}.${suffix}`;
  13. const cleanup = process.env.CI ? `--cleanup` : ``;
  14. const headless$ = android ? headless ? `--headless` : `` : ``;
  15. if (!skipBuild) {
  16. exec.execSync(`detox build --configuration ${configuration}`);
  17. }
  18. exec.execSync(`detox test --configuration ${configuration} --platform ${platform} ${cleanup} ${headless$}`);
  19. }