@@ -323,7 +323,7 @@ added: v18.0.0 |
323 | 323 | changes: |
324 | 324 | - version: REPLACEME |
325 | 325 | pr-url: https://github.com/nodejs/node/pull/43505 |
326 | | - description: add a timeout to tests and allow setting it in options. |
| 326 | + description: Add a `timeout` option. |
327 | 327 | --> |
328 | 328 |
|
329 | 329 | * `name` {string} The name of the test, which is displayed when reporting test |
@@ -346,7 +346,7 @@ changes: |
346 | 346 | the test is `TODO`. **Default:** `false`. |
347 | 347 | * `timeout` {number} A number of milliseconds the test will fail after. |
348 | 348 | If unspecified, subtests inherit this value from their parent. |
349 | | - **Default:** `30_000`. |
| 349 | + **Default:** `Infinity`. |
350 | 350 | * `fn` {Function|AsyncFunction} The function under test. The first argument |
351 | 351 | to this function is a [`TestContext`][] object. If the test uses callbacks, |
352 | 352 | the callback function is passed as the second argument. **Default:** A no-op |
@@ -379,6 +379,11 @@ test('top level test', async (t) => { |
379 | 379 | }); |
380 | 380 | ``` |
381 | 381 |
|
| 382 | +The `timeout` option can be used to fail the test if it takes longer than |
| 383 | +`timeout` milliseconds to complete. However, it is not a reliable mechanism for |
| 384 | +canceling tests because a running test might block the application thread and |
| 385 | +thus prevent the scheduled cancellation. |
| 386 | + |
382 | 387 | ## `describe([name][, options][, fn])` |
383 | 388 |
|
384 | 389 | * `name` {string} The name of the suite, which is displayed when reporting test |
@@ -545,7 +550,7 @@ added: v18.0.0 |
545 | 550 | changes: |
546 | 551 | - version: REPLACEME |
547 | 552 | pr-url: https://github.com/nodejs/node/pull/43505 |
548 | | - description: add a timeout to tests and allow setting it in options. |
| 553 | + description: Add a `timeout` option. |
549 | 554 | --> |
550 | 555 |
|
551 | 556 | * `name` {string} The name of the subtest, which is displayed when reporting |
@@ -567,7 +572,7 @@ changes: |
567 | 572 | the test is `TODO`. **Default:** `false`. |
568 | 573 | * `timeout` {number} A number of milliseconds the test will fail after. |
569 | 574 | If unspecified, subtests inherit this value from their parent. |
570 | | - **Default:** `30_000`. |
| 575 | + **Default:** `Infinity`. |
571 | 576 | * `fn` {Function|AsyncFunction} The function under test. The first argument |
572 | 577 | to this function is a [`TestContext`][] object. If the test uses callbacks, |
573 | 578 | the callback function is passed as the second argument. **Default:** A no-op |
|