skip to Main Content

Reactjs – Strange behavior. Jest gives `Cannot find module` when importing components with absolute paths

My jest config clearMocks: true, rootDir: '../../', cacheDirectory: 'cache', testEnvironment: 'jsdom', modulePaths: [ '<rootDir>' ], setupFilesAfterEnv: [ '<rootDir>/config/jest/setup.ts' ], moduleDirectories: [ 'node_modules', 'src' ], moduleNameMapper: { '\.(jpg|jpeg|png|gif|svg)$': '<rootDir>/config/jest/mocks/file.js', '\.s?css$': 'identity-obj-proxy' }, moduleFileExtensions: [ 'js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'json',…

VIEW QUESTION

Shopify – Expo Jest fails with Cannot find module 'expo/build/winter' from 'node_modules/jest-expo/src/preset/setup.js'

package.json "scripts": { "test": "jest --coverage=false", "testCoverage": "jest" }, "dependencies": { "@config-plugins/react-native-blob-util": "^6.0.0", "@config-plugins/react-native-pdf": "^6.0.0", "@react-native-async-storage/async-storage": "1.18.2", "@react-native-community/datetimepicker": "7.2.0", "@react-native-menu/menu": "^0.9.1", "@react-native-picker/picker": "2.4.10", "@react-navigation/elements": "^1.3.21", "@shopify/flash-list": "1.4.3", "@tamagui/toast": "^1.75.2", "@tanstack/query-core": "^4.36.1", "@tanstack/react-query": "^4.36.1", "axios": "^1.5.1", "babel-plugin-transform-inline-environment-variables": "^0.4.4", "date-fns": "^2.30.0", "dayjs":…

VIEW QUESTION
Back To Top
Search