Closed betCG closed 4 years ago
i am also facing this issue :(
Actually I don't know why it happens.. How I can reproduce this issue? Have any suggestions why it can happen?
@betCG @irfans Just solved this issue:
if you use create-react-app
and react-app-rewired
:
// config-overrides.js
module.exports = {
jest: (config) => {
config.transformIgnorePatterns = ['/node_modules/(?!react-xarrows).+\\.js$'];
return config;
},
};
if you use jest
directly:
// package.json
"jest" : {
"transformIgnorePatterns": [
"/node_modules/(?!react-xarrows).+\\.js$"
]
}
BUT now I'm facing a new issue:
TypeError: Cannot destructure property `startPointObj` of 'undefined' or 'null'.
🤭
something is unvalid or missing with the typescript/babel/webpack configuration files. @walandemar your answer is just a workaround because the files should've already been transformed (means plain javascript files and not typescript files), what you actually do is just transforming ts files to js before testing.
For some reason, it seems that jest is referring to src/index.tsx instead the complied version lib/index.js, I've no idea why.
if someone here has some deep knowledge in these settings, please clone the repo, fix, and open a pull request with the fix. I don't know what causes this and I to fix it.
It was just an issue related to tsconifg file. the target javascript version the ts compiler used was esnext, now, in v1.5.0 the ts files are compiled to javascript version commonjs and now jest should work properly. please update to 1.5.0 and check if the issue still exists.
Hi! i'm having this error while testing my project, it's caused by the library. I'm kinda a noob with testing so if anyone can help me to fix this that would be great.
` FAIL src/components/navbar/NavBar.test.js ● Test suite failed to run