You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Giving the following structure with nested blocks:
beforeEach(fn () => dump('root block called'));
describe('#block1', function () {
beforeEach(fn() => dump('#block1'));
describe('#block1->subBlock#1', function () {
beforeEach(fn() => dump('#block1->subBlock#1'));
it('testing', function () {});
});
});
I would expect the beforeEach from #block1 to be executed
How to Reproduce
Create nested blocks with describe, each one having a beforeEach
Add any test only on the last child of describe
Example
describe('#block1', function () {
beforeEach(fn() => dump('#block1'));
describe('#block1->subBlock#1', function () {
beforeEach(fn() => dump('#block1->subBlock#1'));
it('testing', function () {});
});
});
Sample Repository
No response
Pest Version
2.34.7
PHP Version
8.2.0
Operation System
macOS
Notes
The root beforeEach is executed even when there is no test in same level, you can reproduce it by running the first code provided on "What Happened" section, you will notice that root block called is printed on terminal
The text was updated successfully, but these errors were encountered:
hjJunior
changed the title
[Bug]: When nesting describers and the parent describe doesn't have test it will skip the beforeEach
[Bug]: When nesting describers and the describer parent doesn't have test it will skip the beforeEach
Apr 18, 2024
What Happened
Giving the following structure with nested blocks:
I would expect the beforeEach from
#block1
to be executedHow to Reproduce
Example
Sample Repository
No response
Pest Version
2.34.7
PHP Version
8.2.0
Operation System
macOS
Notes
The root
beforeEach
is executed even when there is no test in same level, you can reproduce it by running the first code provided on "What Happened" section, you will notice thatroot block called
is printed on terminalThe text was updated successfully, but these errors were encountered: