I have one repo after the upgrade to v24.1 im getting this error
TypeError: mappedCoverage.addStatement is not a function as a error if i run jest --coverage
run npm run test:coverage or jest --coverage at https://github.com/growcss/growcss/tree/alpha
Getting a test coverage without an error
https://travis-ci.org/growcss/growcss/jobs/494372887
https://github.com/growcss/growcss/tree/alpha
npx envinfo --preset jestPaste the results here:
System:
OS: Linux 4.20 Manjaro Linux undefined
CPU: (8) x64 Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz
Binaries:
Node: 10.14.2 - ~/.nvm/versions/node/v10.14.2/bin/node
Yarn: 1.12.3 - ~/.yarn/bin/yarn
npm: 6.5.0 - /GitHub/growcss/growcss/node_modules/.bin/npm
npmPackages:
jest: ^24.1.0 => 24.1.0
I also came upon this when upgrading a mono repo codebase. I had to make sure collectCoverageFrom only included my actual source code. It was trying to include files in the node_modules of my individual packages within the mono repo and then hitting this cryptic error it seems. Specifically, this seemed only to occur in packages that had a dependency on another package within the mono repo.
collectCoverageFrom: [ "packages/**/src/*.js"]
did the trick for me but you'll need to tweak that based on your needs.
@dan-weaver thank you for the help/hint.
Im switching right now to rush so i dont have this problem any more :)
Most helpful comment
I also came upon this when upgrading a mono repo codebase. I had to make sure
collectCoverageFromonly included my actual source code. It was trying to include files in the node_modules of my individual packages within the mono repo and then hitting this cryptic error it seems. Specifically, this seemed only to occur in packages that had a dependency on another package within the mono repo.did the trick for me but you'll need to tweak that based on your needs.