eugene-manuilov / jest-runner-groups

A custom runner that allows to tag test files and run groups of tests with Jest.
MIT License
128 stars 14 forks source link

this._config.extraGlobals is not iterable #13

Closed jacklinton closed 4 years ago

jacklinton commented 4 years ago

I'm not sure when this problem cropped up but I suspect it was after I did some package updates in a project.

Previously working tests were showing a Type Error with the message being the title of this issue.

Jest defaults the value of extraGlobals to undefined and so to resolve the errors I had to add the extraGlobals parameter to my Jest config and make it equal and empty array.

The given line number for the error was: node_modules/jest-runner-groups/node_modules/jest-runtime/build/index.js:1759:23 where you use the spread operator on this._config.extraGlobals, at least in my particular environment which is Node.js V12.15.0 and npm V6.14.5.

I guess the desired behavior is that the code should check that config variable's value for undefined before trying to spread the variable.

Thanks for the great package and great work!

jacklinton commented 4 years ago

On second thought, maybe this is a Jest problem and not a problem with your package so feel free to close this if you like.

eugene-manuilov commented 4 years ago

Hey @jacklinton

which version of the jest-runner-groups and jest do you use?

jacklinton commented 4 years ago

Jest is @24.9.0 and jest-runner-groups@1.1.1

On Jun 30, 2020, at 4:01 PM, Eugene Manuilov <notifications@github.com mailto:notifications@github.com > wrote:

Hey @jacklinton

which version of the jest-runner-groups and jest do you use?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jacklinton commented 4 years ago

Do I just need to update to version 2+ of jest-runner-groups?

eugene-manuilov commented 4 years ago

Yes, try to upgrade to the 2nd version of jest-runner-groups. It should help. Let me know if it doesn't.

jacklinton commented 4 years ago

It seems to be working great without the extra param on v2. Thanks for the help and the time Eugene!

eugene-manuilov commented 4 years ago

Awesome! You are welcome, @jacklinton!