@@ -323,7 +323,7 @@ added: REPLACEME
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
@@ -345,7 +345,7 @@ changes:
345
345
the test is ` TODO ` . ** Default:** ` false ` .
346
346
* ` timeout ` {number} A number of milliseconds the test will fail after.
347
347
If unspecified, subtests inherit this value from their parent.
348
- ** Default:** ` 30_000 ` .
348
+ ** Default:** ` Infinity ` .
349
349
* ` fn ` {Function|AsyncFunction} The function under test. The first argument
350
350
to this function is a [ ` TestContext ` ] [ ] object. If the test uses callbacks,
351
351
the callback function is passed as the second argument. ** Default:** A no-op
@@ -378,6 +378,11 @@ test('top level test', async (t) => {
378
378
});
379
379
```
380
380
381
+ The ` timeout ` option can be used to fail the test if it takes longer than
382
+ ` timeout ` milliseconds to complete. However, it is not a reliable mechanism for
383
+ canceling tests because a running test might block the application thread and
384
+ thus prevent the scheduled cancellation.
385
+
381
386
## ` describe([name][, options][, fn]) `
382
387
383
388
* ` name ` {string} The name of the suite, which is displayed when reporting test
@@ -529,7 +534,7 @@ added: REPLACEME
529
534
changes:
530
535
- version: REPLACEME
531
536
pr-url: https://github.com/nodejs/node/pull/43505
532
- description: add a timeout to tests and allow setting it in options .
537
+ description: Add a ` timeout` option .
533
538
-->
534
539
535
540
* ` name ` {string} The name of the subtest, which is displayed when reporting
@@ -551,7 +556,7 @@ changes:
551
556
the test is ` TODO ` . ** Default:** ` false ` .
552
557
* ` timeout ` {number} A number of milliseconds the test will fail after.
553
558
If unspecified, subtests inherit this value from their parent.
554
- ** Default:** ` 30_000 ` .
559
+ ** Default:** ` Infinity ` .
555
560
* ` fn ` {Function|AsyncFunction} The function under test. The first argument
556
561
to this function is a [ ` TestContext ` ] [ ] object. If the test uses callbacks,
557
562
the callback function is passed as the second argument. ** Default:** A no-op
0 commit comments