Uh oh!
There was an error while loading. Please reload this page.
test_runner: improve describe.only behavior - #52296
Conversation
nodejs-github-bot
commented
Mar 31, 2024
Review requested:
|
MoLow
commented
Mar 31, 2024
some examples: describe('1',()=>{it('2');describe('3',()=>{it('4');describe('5',()=>{it('6');it.only('7');});});});===> describe('1',()=>{it('2');describe.only('3',()=>{it('4');describe('5',()=>{it('6');it('7');});});});===> etc |
cjihrig
left a comment
There was a problem hiding this comment.
LGTM, but it's probably worth updating some docs for this.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Apr 1, 2024
nodejs-github-bot
commented
Apr 1, 2024
nodejs-github-bot
commented
Apr 1, 2024
rluvaton
left a comment
There was a problem hiding this comment.
Can you add a test that before and after hooks are not running for unfocused suites? IIRC they do run when there are no tests in describe while I think they shouldn't in this case
@rluvaton can you add these tests in a follow-up PR?. I am not sure what an unfocused suite is |
rluvaton
commented
Apr 2, 2024
sure (what I meant with unfocused are suites that or not in the only scope) |
MoLow
commented
Apr 2, 2024
FWIW this code describe('describe 1',()=>{before(()=>console.log('before describe 1'))beforeEach(()=>console.log('beforeEach describe 1'))it.only(async()=>{console.log(1);})it('no',()=>{});afterEach(()=>console.log('afterEach describe 1'))after(()=>console.log('after describe 1'))})describe('describe 2',()=>{before(()=>console.log('before describe 2'))beforeEach(()=>console.log('beforeEach describe 2'))it('no',()=>{});afterEach(()=>console.log('afterEach describe 2'))after(()=>console.log('after describe 2'))})outputs which seems ok to me |
nodejs-github-bot
commented
Apr 2, 2024
Landed in ac9e5e7 |
marco-ippolito
commented
May 21, 2024
Can you please create a manual backport to v20x? |
Supersedes #48932
this fixes two major issues with
describethat will now run regardless of it not being marked withonly:onlyonly, and no nested test is marked withonly, all its decendents will runthis aligns the behavior with other test runners I have compared with