react-native-navigation的迁移库

test.unit.ios.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const _ = require('lodash');
  2. const exec = require('shell-utils').exec;
  3. const release = _.includes(process.argv, 'release');
  4. function runWithXcpretty(cmd) {
  5. if (exec.which(`xcpretty`)) {
  6. exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
  7. } else {
  8. exec.execSync(`${cmd}`);
  9. }
  10. }
  11. function run() {
  12. const conf = release ? `Release` : `Debug`;
  13. runWithXcpretty(`RCT_NO_LAUNCH_PACKAGER=true
  14. cd ./playground/ios && xcodebuild
  15. build build-for-testing
  16. -scheme "ReactNativeNavigation"
  17. -project playground.xcodeproj
  18. -sdk iphonesimulator
  19. -configuration ${conf}
  20. -derivedDataPath ./DerivedData/playground
  21. ONLY_ACTIVE_ARCH=YES`);
  22. runWithXcpretty(`RCT_NO_LAUNCH_PACKAGER=true
  23. cd ./playground/ios && xcodebuild
  24. test-without-building
  25. -scheme "ReactNativeNavigation"
  26. -project playground.xcodeproj
  27. -sdk iphonesimulator
  28. -configuration ${conf}
  29. -destination 'platform=iOS Simulator,name=iPhone 7'
  30. -derivedDataPath ./DerivedData/playground
  31. ONLY_ACTIVE_ARCH=YES`);
  32. }
  33. run();