itereshchenkov / jest-teamcity

Jest Teamcity Reporter
MIT License
31 stars 13 forks source link

TypeError: Cannot read property 'push' of undefined #13

Closed ohana54 closed 3 years ago

ohana54 commented 3 years ago

When having a describe block with the name "constructor", the above error appears. This is due to how we collect suites: https://github.com/itereshchenkov/jest-teamcity/blob/f1c956b5351b69037e65513a0fec9cff53665751/lib/formatter.js#L110

I'm guessing it's trying to set the object constructor, when path includes the word "constructor", instead of adding a new key with the name "constructor".

ohana54 commented 3 years ago

Might be related to the latest lodash release

jgoz commented 3 years ago

Yes, pinning lodash to 4.17.16 fixes this error for me, which is unfortunate because there is a security warning for versions lower than 4.17.19.

itereshchenkov commented 3 years ago

Good findings 👍 Thanks @jgoz for making a fix for it. I will publish a new package version shortly