react-native-navigation的迁移库

12345678910111213141516171819202122232425262728293031
  1. const detox = require('detox');
  2. const config = require('../package.json').detox;
  3. const exec = require('shell-utils').exec;
  4. jest.setTimeout(300000);
  5. beforeAll(async () => {
  6. await detox.init(config, { launchApp: false });
  7. disableAndroidEmulatorAnimations();
  8. });
  9. afterAll(async () => {
  10. await detox.cleanup();
  11. });
  12. beforeEach(async function() {
  13. await detox.beforeEach(jasmine.testPath);
  14. });
  15. afterEach(async function() {
  16. await detox.afterEach(jasmine.testPath);
  17. });
  18. function disableAndroidEmulatorAnimations() {
  19. if (device.getPlatform() === 'android') {
  20. const deviceId = device._deviceId;
  21. exec.execAsync(`adb -s ${deviceId} shell settings put global window_animation_scale 0.0`);
  22. exec.execAsync(`adb -s ${deviceId} shell settings put global transition_animation_scale 0.0`);
  23. exec.execAsync(`adb -s ${deviceId} shell settings put global animator_duration_scale 0.0`);
  24. }
  25. }