UnhandledPromiseRejectionWarning appears even though rejection is caught
See original GitHub issueDo you want to request a feature or report a bug?
Bug about Manual Mock
What is the current behavior?
All tests that uses a function addNewPath
(ie at least 20 of the 29 tests) succeed except 2 for strange reasons … This function relies on a mock implementation of two modules : fs
and filehound
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install
and yarn test
.
My repo : https://github.com/jy95/mediaScan/tree/test-fix
What is the expected behavior?
It should work
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Jest version : 22.3.0 Node version : 8.9.3 NPM version : 5.6.0 OS : Windows 10 Version 1709
My jest.config.js :
// jest.config.js
module.exports = {
verbose: true,
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"^.+\\.(ts|tsx)$": "<rootDir>/__tests__/__helpers__/preprocessor.js"
},
"testMatch": [
"<rootDir>/__tests__/**/*.(ts|tsx|js)"
],
"testPathIgnorePatterns": ["<rootDir>/node_modules/", "<rootDir>/__tests__/__helpers__/"],
"collectCoverage": true
};
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top GitHub Comments
I just installed jest according to the instructions. And no matter how I run it I get…
node:7364) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property ‘Symbol(Symbol.iterator)’ of undefined (node:7364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
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.