react-native-navigation的迁移库

test.unit.ios.js 962B

123456789101112131415161718192021222324252627282930313233343536
  1. const shellUtils = require('shell-utils');
  2. function runWithXcprettyIfPossible(cmd) {
  3. if (hasXcpretty()) {
  4. shellUtils.exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
  5. } else {
  6. shellUtils.exec.execSync(`${cmd}`);
  7. }
  8. }
  9. function hasXcpretty() {
  10. try {
  11. return shellUtils.exec.execSyncRead(`which xcpretty`);
  12. } catch (e) {
  13. return false;
  14. }
  15. }
  16. function run() {
  17. runWithXcprettyIfPossible(`RCT_NO_LAUNCH_PACKAGER=true
  18. cd ./playground/ios && xcodebuild
  19. build build-for-testing
  20. -scheme "playground"
  21. -project playground.xcodeproj
  22. -sdk iphonesimulator
  23. -configuration Debug`);
  24. runWithXcprettyIfPossible(`RCT_NO_LAUNCH_PACKAGER=true
  25. cd ./playground/ios && xcodebuild
  26. test-without-building
  27. -scheme "playground"
  28. -project playground.xcodeproj
  29. -destination 'platform=iOS Simulator,name=iPhone 7'`);
  30. }
  31. run();