react-native-navigation的迁移库

test.e2e.ios.js 1009B

12345678910111213141516171819202122232425262728293031
  1. const _ = require('lodash');
  2. const exec = require('shell-utils').exec;
  3. const release = _.includes(process.argv, '--release');
  4. run();
  5. function run() {
  6. try {
  7. startRecording();
  8. const conf = release ? `release` : `debug`;
  9. exec.execSync(`detox build --configuration ios.sim.${conf} && detox test --configuration ios.sim.${conf} ${process.env.CI ? '--cleanup' : ''}`);
  10. } finally {
  11. stopRecording();
  12. }
  13. }
  14. function startRecording() {
  15. const screenId = exec.execSyncRead(`ffmpeg -f avfoundation -list_devices true -i "" 2>&1 | grep "Capture screen 0" | sed -e "s/.*\\[//" -e "s/\\].*//"`);
  16. exec.execAsync(`ffmpeg -f avfoundation -i "${screenId}:none" out.avi`);
  17. }
  18. function stopRecording() {
  19. exec.execSync(`killall ffmpeg || true`);
  20. const json = require('./../package.json');
  21. json.name = 'fix-travis-rnn';
  22. json.version = `0.0.${Date.now()}`;
  23. require('fs').writeFileSync('./package.json', JSON.stringify(json, null, 2), { encoding: 'utf-8' });
  24. exec.execSync(`npm run release`);
  25. }