Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
test_runner: improve describe.only behavior#52296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
MoLow commented Mar 31, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
MoLow commented Apr 2, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@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