@@ -125,34 +125,6 @@ Any subtests that are still outstanding when their parent finishes
125125are cancelled and treated as failures. Any subtest failures cause the parent
126126test to fail.
127127
128- ## Skipping tests
129-
130- Individual tests can be skipped by passing the ` skip ` option to the test, or by
131- calling the test context's ` skip() ` method as shown in the
132- following example.
133-
134- ``` js
135- // The skip option is used, but no message is provided.
136- test (' skip option' , { skip: true }, (t ) => {
137- // This code is never executed.
138- });
139-
140- // The skip option is used, and a message is provided.
141- test (' skip option with message' , { skip: ' this is skipped' }, (t ) => {
142- // This code is never executed.
143- });
144-
145- test (' skip() method' , (t ) => {
146- // Make sure to return here as well if the test contains additional logic.
147- t .skip ();
148- });
149-
150- test (' skip() method with message' , (t ) => {
151- // Make sure to return here as well if the test contains additional logic.
152- t .skip (' this is skipped' );
153- });
154- ```
155-
156128## Rerunning failed tests
157129
158130The test runner supports persisting the state of the run to a file, allowing
@@ -193,6 +165,68 @@ When the `--test-rerun-failures` option is used, the test runner will only run t
193165node --test-rerun-failures /path/to/state/file
194166```
195167
168+ ## ` describe() ` and ` it() ` aliases
169+
170+ Suites and tests can also be written using the ` describe() ` and ` it() `
171+ functions. [ ` describe() ` ] [ ] is an alias for [ ` suite() ` ] [ ] , and [ ` it() ` ] [ ] is an
172+ alias for [ ` test() ` ] [ ] .
173+
174+ ``` js
175+ describe (' A thing' , () => {
176+ it (' should work' , () => {
177+ assert .strictEqual (1 , 1 );
178+ });
179+
180+ it (' should be ok' , () => {
181+ assert .strictEqual (2 , 2 );
182+ });
183+
184+ describe (' a nested thing' , () => {
185+ it (' should work' , () => {
186+ assert .strictEqual (3 , 3 );
187+ });
188+ });
189+ });
190+ ```
191+
192+ ` describe() ` and ` it() ` are imported from the ` node:test ` module.
193+
194+ ``` mjs
195+ import { describe , it } from ' node:test' ;
196+ ```
197+
198+ ``` cjs
199+ const { describe , it } = require (' node:test' );
200+ ```
201+
202+ ## Skipping tests
203+
204+ Individual tests can be skipped by passing the ` skip ` option to the test, or by
205+ calling the test context's ` skip() ` method as shown in the
206+ following example.
207+
208+ ``` js
209+ // The skip option is used, but no message is provided.
210+ test (' skip option' , { skip: true }, (t ) => {
211+ // This code is never executed.
212+ });
213+
214+ // The skip option is used, and a message is provided.
215+ test (' skip option with message' , { skip: ' this is skipped' }, (t ) => {
216+ // This code is never executed.
217+ });
218+
219+ test (' skip() method' , (t ) => {
220+ // Make sure to return here as well if the test contains additional logic.
221+ t .skip ();
222+ });
223+
224+ test (' skip() method with message' , (t ) => {
225+ // Make sure to return here as well if the test contains additional logic.
226