-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
42 lines (40 loc) · 1.13 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
31
32
33
34
35
36
37
38
39
40
41
42
const { jsWithTsESMLegacy: tsjPreset } = require("ts-jest/presets");
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig.json");
const packagesToTransform = [
"react-native",
"react-native-(.*)",
"@react-native/(.*)",
"@react-native-community",
"@react-navigation",
"expo",
"expo-(.*)",
"@expo(nent)?",
"@expo-google-fonts",
"react-navigation",
"@react-navigation/.*",
"@unimodules",
"unimodules",
"sentry-expo",
"native-base",
"react-native-svg",
"tamagui",
"@tamagui/(.*)",
"moti",
];
/** @type {import("jest").Config} */
module.exports = {
transformIgnorePatterns: [
`node_modules/(?!(${packagesToTransform.join("|")})/)`,
],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
testRegex: "\\.test\\.[jt]sx?$",
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
setupFilesAfterEnv: ["<rootDir>/jest-setup.js"],
modulePaths: [compilerOptions.baseUrl],
preset: "jest-expo",
roots: ["."],
collectCoverage: true,
collectCoverageFrom: ["src/**/*.{ts,tsx}"],
// extensionsToTreatAsEsm: [".tsx", ".ts", ".jsx"],
};