Skip to content

Commit 585cbb2

Browse files
benjamingrtargos
authored andcommitted
doc: use precise terminology in test runner
We currently use `resolve` which is incorrect from a technical point of view in several places in the test runner docs. For anyone wondering "resolves" means the promise's fate is known by either settling (becoming fulfilled or rejected) or because it's assimilating the status of another promise (that may be unfulfilled). PR-URL: #50028 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
1 parent d9c791a commit 585cbb2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/api/test.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ processed in one of three ways:
4444
1. A synchronous function that is considered failing if it throws an exception,
4545
and is considered passing otherwise.
4646
2. A function that returns a `Promise` that is considered failing if the
47-
`Promise` rejects, and is considered passing if the `Promise` resolves.
47+
`Promise` rejects, and is considered passing if the `Promise` fulfills.
4848
3. A function that receives a callback function. If the callback receives any
4949
truthy value as its first argument, the test is considered failing. If a
5050
falsy value is passed as the first argument to the callback, the test is
@@ -67,7 +67,7 @@ test('synchronous failing test', (t) => {
6767

6868
test('asynchronous passing test', async (t) => {
6969
// This test passes because the Promise returned by the async
70-
// function is not rejected.
70+
// function is settled and not rejected.
7171
assert.strictEqual(1, 1);
7272
});
7373

@@ -1001,7 +1001,7 @@ changes:
10011001
to this function is a [`TestContext`][] object. If the test uses callbacks,
10021002
the callback function is passed as the second argument. **Default:** A no-op
10031003
function.
1004-
* Returns: {Promise} Resolved with `undefined` once
1004+
* Returns: {Promise} Fulfilled with `undefined` once
10051005
the test completes, or immediately if the test runs within [`describe()`][].
10061006

10071007
The `test()` function is the value imported from the `test` module. Each
@@ -1011,8 +1011,8 @@ The `TestContext` object passed to the `fn` argument can be used to perform
10111011
actions related to the current test. Examples include skipping the test, adding
10121012
additional diagnostic information, or creating subtests.
10131013

1014-
`test()` returns a `Promise` that resolves once the test completes.
1015-
if `test()` is called within a `describe()` block, it resolve immediately.
1014+
`test()` returns a `Promise` that fulfills once the test completes.
1015+
if `test()` is called within a `describe()` block, it fulfills immediately.
10161016
The return value can usually be discarded for top level tests.
10171017
However, the return value from subtests should be used to prevent the parent
10181018
test from finishing first and cancelling the subtest
@@ -2508,7 +2508,7 @@ changes:
25082508
to this function is a [`TestContext`][] object. If the test uses callbacks,
25092509
the callback function is passed as the second argument. **Default:** A no-op
25102510
function.
2511-
* Returns: {Promise} Resolved with `undefined` once the test completes.
2511+
* Returns: {Promise} Fulfilled with `undefined` once the test completes.
25122512

25132513
This function is used to create subtests under the current test. This function
25142514
behaves in the same fashion as the top level [`test()`][] function.

0 commit comments

Comments
 (0)