Skip to content

Commit d3a5f1f

Browse files
authored
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 588784e commit d3a5f1f

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

@@ -984,7 +984,7 @@ changes:
984984
to this function is a [`TestContext`][] object. If the test uses callbacks,
985985
the callback function is passed as the second argument. **Default:** A no-op
986986
function.
987-
* Returns: {Promise} Resolved with `undefined` once
987+
* Returns: {Promise} Fulfilled with `undefined` once
988988
the test completes, or immediately if the test runs within [`describe()`][].
989989

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

997-
`test()` returns a `Promise` that resolves once the test completes.
998-
if `test()` is called within a `describe()` block, it resolve immediately.
997+
`test()` returns a `Promise` that fulfills once the test completes.
998+
if `test()` is called within a `describe()` block, it fulfills immediately.
999999
The return value can usually be discarded for top level tests.
10001000
However, the return value from subtests should be used to prevent the parent
10011001
test from finishing first and cancelling the subtest
@@ -2497,7 +2497,7 @@ changes:
24972497
to this function is a [`TestContext`][] object. If the test uses callbacks,
24982498
the callback function is passed as the second argument. **Default:** A no-op
24992499
function.
2500-
* Returns: {Promise} Resolved with `undefined` once the test completes.
2500+
* Returns: {Promise} Fulfilled with `undefined` once the test completes.
25012501

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

0 commit comments

Comments
 (0)