react-native-navigation的迁移库

init.js 713B

12345678910111213141516171819202122
  1. const detox = require('detox');
  2. const config = require('../package.json').detox;
  3. const exec = require('shell-utils').exec;
  4. before(async () => {
  5. await detox.init(config, { launchApp: false });
  6. disableAndroidEmulatorAnimations();
  7. });
  8. after(async () => {
  9. await detox.cleanup();
  10. });
  11. function disableAndroidEmulatorAnimations() {
  12. if (device.getPlatform() === 'android') {
  13. const deviceId = device._deviceId;
  14. exec.execAsync(`adb -s ${deviceId} shell settings put global window_animation_scale 0.0`);
  15. exec.execAsync(`adb -s ${deviceId} shell settings put global transition_animation_scale 0.0`);
  16. exec.execAsync(`adb -s ${deviceId} shell settings put global animator_duration_scale 0.0`);
  17. }
  18. }