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
{{ message }}
Repository navigation
describe block without it does not trigger hooks #45028
It looks like nested beforeEach() does work with describe()/it() syntax. However, describe() with no tests does not trigger the hook. If you add an it() at the same level as describe('inner'), then it works as expected.
@MoLow is this a bug or intended behavior? I don't know what other test runners do in this case, but I'm leaning toward bug.
changed the title [-]Nested suite beforeEach context works for `test` but not `describe`[/-][+]`describe` block without `it` does not trigger hooks[/+]on Oct 16, 2022
Activity
cjihrig commentedon Oct 16, 2022
It looks like nested
beforeEach()does work withdescribe()/it()syntax. However,describe()with no tests does not trigger the hook. If you add anit()at the same level asdescribe('inner'), then it works as expected.@MoLow is this a bug or intended behavior? I don't know what other test runners do in this case, but I'm leaning toward bug.
[-]Nested suite beforeEach context works for `test` but not `describe`[/-][+]`describe` block without `it` does not trigger hooks[/+]scally commentedon Oct 16, 2022
FWIW, this works in Jest
MoLow commentedon Oct 18, 2022
this is not intended
test_runner: call {before,after}Each() on suites
test_runner: call {before,after}Each() on suites
test_runner: call {before,after}Each() on suites
test_runner: call {before,after}Each() on suites
test_runner: call {before,after}Each() on suites
fix: call {before,after}Each() on suites
fix: call {before,after}Each() on suites
fix: call {before,after}Each() on suites