Jest config updates; fixes for slower tests (#1401)

* Speed up ObsEdit test with jest-test-time

* Update jest config and standardize accessibility tests

* Add test:memory to package json
This commit is contained in:
Amanda Bullington
2024-04-17 10:07:29 -07:00
committed by GitHub
parent 4117a8294f
commit 0833d2ddf0
16 changed files with 390 additions and 101 deletions

29
jest.config.ts Normal file
View File

@@ -0,0 +1,29 @@
import type {Config} from 'jest';
const config: Config = {
moduleNameMapper: {
"\\.svg": "<rootDir>/tests/mocks/svgMock.js"
},
preset: "react-native",
setupFiles: [
"./node_modules/react-native-gesture-handler/jestSetup.js",
"<rootDir>/tests/jest.setup.js"
],
globalSetup: "<rootDir>/tests/jest.globalSetup.js",
setupFilesAfterEnv: [
"react-native-accessibility-engine",
"<rootDir>/tests/jest.post-setup.js",
"<rootDir>/tests/realm.setup.js",
"<rootDir>/tests/initI18next.setup.js"
],
transformIgnorePatterns: [
"node_modules/(?!(jest-)?@react-native|react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base||(?!react-native-redash))|jest-runner"
],
verbose: true,
// uncomment reporters below to see which tests are running the slowest in jest
// reporters: [
// ["jest-slow-test-reporter", {"numTests": 8, "warnOnSlowerThan": 300, "color": true}]
// ],
};
export default config;