From 8f9e20808557750035b9ecedb22ab6ddb8c4d3a9 Mon Sep 17 00:00:00 2001 From: Randy Tarampi Date: Sun, 21 Apr 2019 15:01:23 -0700 Subject: [PATCH] Prefer `jest-circus/runner` so we bail out when `beforeAll` explodes. Per https://github.com/facebook/jest/issues/2713#issuecomment-430932326 --- e2e/__tests__/appium-test-wd.js | 3 ++- e2e/jest.config.json | 1 + jest.config.json | 1 + package.json | 1 + yarn.lock | 22 ++++++++++++++++++++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/e2e/__tests__/appium-test-wd.js b/e2e/__tests__/appium-test-wd.js index 5546d8b..413c1d9 100644 --- a/e2e/__tests__/appium-test-wd.js +++ b/e2e/__tests__/appium-test-wd.js @@ -3,11 +3,12 @@ import * as wd from 'wd'; import * as capabilities from '../capabilities'; import {DEVICE_TIMEOUT, JEST_TIMEOUT, TARGET_PLATFORM} from '../constants'; +jest.setTimeout(JEST_TIMEOUT); + describe('Create Android session (wd)', () => { let driver; beforeAll(async () => { - jest.setTimeout(JEST_TIMEOUT); const {capabilities: deviceConfig, ...serverConfig} = capabilities[TARGET_PLATFORM]; diff --git a/e2e/jest.config.json b/e2e/jest.config.json index 1238c70..e5c211f 100644 --- a/e2e/jest.config.json +++ b/e2e/jest.config.json @@ -1,3 +1,4 @@ { + "testRunner": "jest-circus/runner", "verbose": true } diff --git a/jest.config.json b/jest.config.json index 3821fc1..7febdfe 100644 --- a/jest.config.json +++ b/jest.config.json @@ -5,5 +5,6 @@ "/node_modules/", "/e2e/" ], + "testRunner": "jest-circus/runner", "verbose": true } diff --git a/package.json b/package.json index 95e81c3..af6c369 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "emulator:android:kill": "if [ -f /tmp/$(node -p 'require(\"./package.json\").name').emulator.android.pid ]; then echo \"Killing Android emulator (`cat /tmp/$(node -p 'require(\"./package.json\").name').emulator.android.pid`) from /tmp/$(node -p 'require(\"./package.json\").name').emulator.android.pid\"; kill -9 `cat /tmp/$(node -p 'require(\"./package.json\").name').emulator.android.pid`; rm /tmp/$(node -p 'require(\"./package.json\").name').emulator.android.pid; fi;" }, "dependencies": { + "jest-circus": "^24.7.1", "react": "16.8.3", "react-native": "0.59.4" }, diff --git a/yarn.lock b/yarn.lock index fbec858..c81d29f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4736,6 +4736,28 @@ jest-changed-files@^24.7.0: execa "^1.0.0" throat "^4.0.0" +jest-circus@^24.7.1: + version "24.7.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-24.7.1.tgz#f8dc4db5217eb010d71ad2f5b6e6f357590ccd01" + integrity sha512-zDNSS+7qQN0nSbR77qcOb+tOUWLcvZGzvXE1PjoV6xeHV5Vz7DPK9JkBIQF/n5Nz9yZbApDxq5NqGqmVCe0nnQ== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.7.1" + "@jest/test-result" "^24.7.1" + "@jest/types" "^24.7.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.7.1" + is-generator-fn "^2.0.0" + jest-each "^24.7.1" + jest-matcher-utils "^24.7.0" + jest-message-util "^24.7.1" + jest-snapshot "^24.7.1" + jest-util "^24.7.1" + pretty-format "^24.7.0" + stack-utils "^1.0.1" + throat "^4.0.0" + jest-cli@^24.7.1: version "24.7.1" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.7.1.tgz#6093a539073b6f4953145abeeb9709cd621044f1"