Sfoglia il codice sorgente

Upgrade to detox 8.x.x (#3811)

Yogev Ben David 6 anni fa
parent
commit
069f1a7408
No account linked to committer's email address
2 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 7
    7
      e2e/init.js
  2. 1
    1
      package.json

+ 7
- 7
e2e/init.js Vedi File

1
 const detox = require('detox');
1
 const detox = require('detox');
2
 const config = require('../package.json').detox;
2
 const config = require('../package.json').detox;
3
 const exec = require('shell-utils').exec;
3
 const exec = require('shell-utils').exec;
4
+const adapter = require('detox/runners/jest/adapter');
5
+
4
 jest.setTimeout(300000);
6
 jest.setTimeout(300000);
7
+jasmine.getEnv().addReporter(adapter); // don't forget this line
5
 
8
 
6
 beforeAll(async () => {
9
 beforeAll(async () => {
7
-  await detox.init(config, { launchApp: false });
10
+  await detox.init(config, {launchApp: false});
8
   disableAndroidEmulatorAnimations();
11
   disableAndroidEmulatorAnimations();
9
 });
12
 });
10
 
13
 
11
 afterAll(async () => {
14
 afterAll(async () => {
15
+  await adapter.afterAll();
12
   await detox.cleanup();
16
   await detox.cleanup();
13
 });
17
 });
14
 
18
 
15
-beforeEach(async function() {
16
-    await detox.beforeEach(jasmine.testPath);
17
-});
18
-
19
-afterEach(async function() {
20
-    await detox.afterEach(jasmine.testPath);
19
+beforeEach(async () => {
20
+  await adapter.beforeEach();
21
 });
21
 });
22
 
22
 
23
 function disableAndroidEmulatorAnimations() {
23
 function disableAndroidEmulatorAnimations() {

+ 1
- 1
package.json Vedi File

64
     "@types/react": "16.x.x",
64
     "@types/react": "16.x.x",
65
     "@types/react-native": "0.51.x",
65
     "@types/react-native": "0.51.x",
66
     "@types/react-test-renderer": "16.x.x",
66
     "@types/react-test-renderer": "16.x.x",
67
-    "detox": "7.x.x",
67
+    "detox": "8.x.x",
68
     "handlebars": "4.x.x",
68
     "handlebars": "4.x.x",
69
     "jest": "22.x.x",
69
     "jest": "22.x.x",
70
     "react": "16.2.0",
70
     "react": "16.2.0",