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

global.beforeEach run even for not included groups #23

Closed hananmalka closed 2 years ago

hananmalka commented 3 years ago

I have a jest setup file which contains a group of actions to run in beforeEach():

global.beforeEach(async () => {
console.log("Hello World")
});

In my tests file I have several tests from different groups(sanity/regression etc') The groups defined in test level and not in describe level.

When running one of the groups, the global.beforeEach() is running for the other group as well.

My expectation is that global.beforeEach will run only for the relevant group.

Is there a way to do it?

eugene-manuilov commented 3 years ago

@hananmalka unfortunately, you can't use groups per test/describe level. You can define groups per file only.