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

Runtime access to running group #36

Closed mpeyper closed 3 years ago

mpeyper commented 3 years ago

This may be strange request, but is it possible for the test file to know which group is running?

I've got a fairly unique use case where my library supports multiple react renderers (dom, native and server). Most tests are applicable to all the renderers but some have different functionality for the server renderer. I'm looking for a way to run the same test against a subset of the renderers but only import the one for the test group being run (I'm happy to run it separately for each group) as the imports have side effects so I don't want to import them all and loop over them in the test file.

Is that something that jest-runner-groups supports or would consider supporting if it's even possible? It's ok if it's not.

mpeyper commented 3 years ago

I've solved this in other ways.