@@ -1407,6 +1407,11 @@ run({ files: [path.resolve('./tests/test.js')] })
14071407added:
14081408 - v22.0.0
14091409 - v20.13.0
1410+ changes:
1411+ - version:
1412+ - REPLACEME
1413+ pr-url: https://github.com/nodejs/node/pull/xxxxx
1414+ description: This function no longer returns a `Promise`.
14101415-->
14111416
14121417* ` name ` {string} The name of the suite, which is displayed when reporting test
@@ -1417,7 +1422,6 @@ added:
14171422* ` fn ` {Function|AsyncFunction} The suite function declaring nested tests and
14181423 suites. The first argument to this function is a [ ` SuiteContext ` ] [ ] object.
14191424 ** Default:** A no-op function.
1420- * Returns: {Promise} Immediately fulfilled with ` undefined ` .
14211425
14221426The ` suite() ` function is imported from the ` node:test ` module.
14231427
@@ -1461,6 +1465,10 @@ added:
14611465 - v18.0.0
14621466 - v16.17.0
14631467changes:
1468+ - version:
1469+ - REPLACEME
1470+ pr-url: https://github.com/nodejs/node/pull/xxxxx
1471+ description: This function no longer returns a `Promise`.
14641472 - version:
14651473 - v20.2.0
14661474 - v18.17.0
@@ -1510,8 +1518,6 @@ changes:
15101518 to this function is a [ ` TestContext ` ] [ ] object. If the test uses callbacks,
15111519 the callback function is passed as the second argument. ** Default:** A no-op
15121520 function.
1513- * Returns: {Promise} Fulfilled with ` undefined ` once
1514- the test completes, or immediately if the test runs within a suite.
15151521
15161522The ` test() ` function is the value imported from the ` test ` module. Each
15171523invocation of this function results in reporting the test to the {TestsStream}.
@@ -1520,26 +1526,6 @@ The `TestContext` object passed to the `fn` argument can be used to perform
15201526actions related to the current test. Examples include skipping the test, adding
15211527additional diagnostic information, or creating subtests.
15221528
1523- ` test() ` returns a ` Promise ` that fulfills once the test completes.
1524- if ` test() ` is called within a suite, it fulfills immediately.
1525- The return value can usually be discarded for top level tests.
1526- However, the return value from subtests should be used to prevent the parent
1527- test from finishing first and cancelling the subtest
1528- as shown in the following example.
1529-
1530- ``` js
1531- test (' top level test' , async (t ) => {
1532- // The setTimeout() in the following subtest would cause it to outlive its
1533- // parent test if 'await' is removed on the next line. Once the parent test
1534- // completes, it will cancel any outstanding subtests.
1535- await t .test (' longer running subtest' , async (t ) => {
1536- return new Promise ((resolve , reject ) => {
1537- setTimeout (resolve, 1000 );
1538- });
1539- });
1540- });
1541- ```
1542-
15431529The ` timeout ` option can be used to fail the test if it takes longer than
15441530` timeout ` milliseconds to complete. However, it is not a reliable mechanism for
15451531canceling tests because a running test might block the application thread and
0 commit comments