test_runner: allow nesting test within describe#46544
test_runner: allow nesting test within describe#46544nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
|
Review requested:
|
Maybe |
In fact... for |
describe builds the test tree before running it, to aviod the need of adding an |
That... it's a reason, maybe that detail should be clarified in the docs. |
|
|
||
| function test(name, options, fn) { | ||
| const subtest = getGlobalRoot().createSubtest(Test, name, options, fn); | ||
| const parent = testResources.get(executionAsyncId()) || getGlobalRoot(); |
| it('timed out async test', { timeout: 5 }, async () => { | ||
| return new Promise((resolve) => { | ||
| setTimeout(resolve, 1000); | ||
| setTimeout(resolve, 100); |
There was a problem hiding this comment.
Should these setTimeouts use common platform timeout machinery or are you convinced there is no/little flakiness potential here?
There was a problem hiding this comment.
we have already changed these values in the equivalent test recipe test
node/test/message/test_runner_output.js
Line 116 in 5092346
|
Landed in 2787e2d |
PR-URL: nodejs#46544 Fixes: nodejs#46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #46544 Fixes: #46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #46544 Fixes: #46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#46544 Fixes: nodejs#46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#46544 Fixes: nodejs#46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#46544 Fixes: nodejs#46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #46544 Backport-PR-URL: #46839 Fixes: #46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #46544 Backport-PR-URL: #46839 Fixes: #46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs/node#46544 Fixes: nodejs/node#46478 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> (cherry picked from commit 2787e2dfc2e10c584259ff34d7aad565447a84d9)
Fixes: #46478
although initially
testanddescribewere not meant to be used together I see no reason why not to allow this,as the use case demonstrated in #46478 (comment) is valid.
additionally, other test runners such as playwright and mocha also support this.
another outcome of this change is that running a nested
testwithintestwill now work the same wayt.testdid previously, wich sounds reasonable to me as well