-
Notifications
You must be signed in to change notification settings - Fork 577
/
jest.config.js
30 lines (29 loc) · 1.04 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const moduleNameMap = require("./alias").jestModuleNameMap
module.exports = {
cacheDirectory: ".cache/jest",
moduleFileExtensions: ["ts", "tsx", "js"],
moduleNameMapper: moduleNameMap,
preset: "react-native",
rootDir: "./",
setupFilesAfterEnv: [
"jest-extended/all",
"@testing-library/jest-native/extend-expect",
"./src/setupJest.tsx",
"./node_modules/react-native-gesture-handler/jestSetup.js",
],
testMatch: ["<rootDir>/**/*.tests.(ts|tsx|js)"],
testEnvironment: "jest-environment-jsdom",
testEnvironmentOptions: {
url: "http://localhost/",
},
transform: {
"^[./a-zA-Z0-9$_-]+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$":
"<rootDir>/node_modules/react-native/jest/assetFileTransformer.js",
".*(ts|tsx|js|jsx)$": "babel-jest",
"\\.graphql$": "jest-raw-loader",
},
transformIgnorePatterns: [
"node_modules/(?!(react-native(-.*)?/(@react-native-community/.*))?|react-navigation|@react-navigation/.*)",
],
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
}