Skip to content

Commit 67270af

Browse files
committed
Jest configuration improvments
1 parent b442c9e commit 67270af

File tree

4 files changed

+13
-44
lines changed

4 files changed

+13
-44
lines changed

__tests__/App-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import App from '../App/App';
99
// Note: test renderer must be required after react-native.
1010
import renderer from 'react-test-renderer';
1111

12-
it('renders correctly', () => {
12+
jest.useFakeTimers();
13+
14+
it('renders correctly', async () => {
1315
renderer.create(<App />);
1416
});

jest.setup.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"start": "node node_modules/react-native/local-cli/cli.js start",
7-
"test": "jest",
7+
"test": "jest --detectOpenHandles",
88
"prettier-fix": "prettier --write **/*.js",
99
"prettier-check": "prettier --list-different **/*.js",
1010
"lint-fix": "eslint --fix .",
@@ -16,7 +16,7 @@
1616
"prop-types": "^15.7.2",
1717
"react": "16.8.3",
1818
"react-native": "0.59.9",
19-
"react-native-gesture-handler": "^1.1.0",
19+
"react-native-gesture-handler": "^1.3.0",
2020
"react-navigation": "^3.6.0",
2121
"react-redux": "^6.0.1",
2222
"redux": "^4.0.1",
@@ -47,11 +47,11 @@
4747
},
4848
"jest": {
4949
"preset": "react-native",
50-
"transformIgnorePatterns": [
51-
"node_modules/(?!(jest-)?react-native|react-navigation|@react-navigation.*)"
52-
],
5350
"setupFiles": [
54-
"./jest.setup.js"
51+
"./node_modules/react-native-gesture-handler/jestSetup.js"
52+
],
53+
"transformIgnorePatterns": [
54+
"/node_modules/(?!react-native|@react-navigation)/.+"
5555
]
5656
}
5757
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5793,10 +5793,10 @@ react-lifecycles-compat@^3.0.4:
57935793
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
57945794
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
57955795

5796-
react-native-gesture-handler@^1.1.0:
5797-
version "1.1.0"
5798-
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.1.0.tgz#2a7d545ad2e0ca23adce22b2af441ad360ecccee"
5799-
integrity sha512-E9IKHpmL+sz/iCYkUriTUjBaQBORWV+oheYPQleADkxjo2sYsQfnlyTz4EQYFONkUwJ6WmfTNkYt2/yc5U4Ziw==
5796+
react-native-gesture-handler@^1.3.0:
5797+
version "1.3.0"
5798+
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.3.0.tgz#d0386f565928ccc1849537f03f2e37fd5f6ad43f"
5799+
integrity sha512-ASRFIXBuKRvqlmwkWJhV8yP2dTpvcqVrLNpd7FKVBFHYWr6SAxjGyO9Ik8w1lAxDhMlRP2IcJ9p9eq5X2WWeLQ==
58005800
dependencies:
58015801
hoist-non-react-statics "^2.3.1"
58025802
invariant "^2.2.2"

0 commit comments

Comments
 (0)