Closed pranava3812 closed 2 years ago
Facing this issue in Travis CI. Any idea what's happening?
$ node --version
v14.17.5
$ npm --version
6.14.14
$ nvm --version
0.38.0
$ yarn --version
1.22.4
yarn run v1.22.4
$ jest --runInBand
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Object.<anonymous> (/home/travis/build/<project>/node_modules/jest-snapshot/node_modules/@babel/highlight/node_modules/chalk/index.js:73:28)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/home/travis/build/<project>/node_modules/jest-snapshot/node_modules/@babel/highlight/lib/index.js:14:15)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
error Command failed with exit code 1.
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Recently we did migration in react-native from 0.59 to 0.63 and updated all required modules as well. Post that all the test cases are failing with below error. For reference added all config details. FAIL src/assets/IconSun.test.tsx ● Test suite failed to run
babel.config.js
module.exports = { presets: ['module:metro-react-native-babel-preset'], };
jest.config.js const jestPreset = require('@testing-library/react-native/jest-preset');
const transformNodeModules = ['@rnc', 'react-native', 'react-native-svg', 'react-navigation'];
module.exports = { preset: '@testing-library/react-native', // transformIgnorePatterns: [/src/setupTests.js'],
collectCoverageFrom: ['/src/*/.{ts,tsx}'],
coveragePathIgnorePatterns: ['/test-utils/'],
coverageDirectory: './coverage',
coverageThreshold: {
global: {
branches: 5,
functions: 5,
lines: 5,
statements: 5,
},
},
};
node_modules/(?!(${transformNodeModules.join('|')})/)
], transformIgnorePatterns: [ "node_modules/(?!(jest-)?react-native|react-(native|universal|navigation)-(.)|@react-native-community/(.)|@react-navigation/(.*)|bs-platform|@rootstrap/redux-tools)" ], setupFiles: [...jestPreset.setupFiles, 'package json : "react-native": "0.63.4", "jest": "^24.8.0", "metro-react-native-babel-preset": "0.65.2", "babel-jest": "^24.8.0", "babel-loader": "^8.0.4",
tsconfig.json
{ "compilerOptions": { "rootDirs": ["src"], "outDir": "dist", "target": "es2017", "lib": ["es2018"], "module": "es2015", "moduleResolution": "node", "types": ["react", "react-native", "jest"], "jsx": "react-native", "declaration": true, "removeComments": true, "strict": true, "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noUnusedLocals": true, "allowSyntheticDefaultImports": true, "experimentalDecorators": true, "noImplicitAny": false, "sourceMap": true }, "include": ["typings/*.d.ts", "src/*/"], "exclude": [ "dist", "ios", "node_modules", "android", "/mocks", "/tests", "/.test.", "/test-utils", "index.js", "index.*.js" ] }