@@ -135,6 +135,22 @@ declare module 'node:test' {
135135 function test ( name ?: string , options ?: TestOptions , fn ?: TestFn ) : Promise < void > ;
136136 function test ( options ?: TestOptions , fn ?: TestFn ) : Promise < void > ;
137137 function test ( fn ?: TestFn ) : Promise < void > ;
138+ namespace test {
139+ export {
140+ after ,
141+ afterEach ,
142+ before ,
143+ beforeEach ,
144+ describe ,
145+ it ,
146+ run ,
147+ mock ,
148+ test ,
149+ skip ,
150+ todo ,
151+ only
152+ } ;
153+ }
138154 /**
139155 * The `describe()` function imported from the `node:test` module. Each
140156 * invocation of this function results in the creation of a Subtest.
@@ -164,6 +180,14 @@ declare module 'node:test' {
164180 function todo ( name ?: string , fn ?: SuiteFn ) : void ;
165181 function todo ( options ?: TestOptions , fn ?: SuiteFn ) : void ;
166182 function todo ( fn ?: SuiteFn ) : void ;
183+ /**
184+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
185+ * @since v18.15.0
186+ */
187+ function only ( name ?: string , options ?: TestOptions , fn ?: SuiteFn ) : void ;
188+ function only ( name ?: string , fn ?: SuiteFn ) : void ;
189+ function only ( options ?: TestOptions , fn ?: SuiteFn ) : void ;
190+ function only ( fn ?: SuiteFn ) : void ;
167191 }
168192 /**
169193 * Shorthand for `test()`.
@@ -186,7 +210,39 @@ declare module 'node:test' {
186210 function todo ( name ?: string , fn ?: TestFn ) : void ;
187211 function todo ( options ?: TestOptions , fn ?: TestFn ) : void ;
188212 function todo ( fn ?: TestFn ) : void ;
213+ /**
214+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
215+ * @since v18.15.0
216+ */
217+ function only ( name ?: string , options ?: TestOptions , fn ?: TestFn ) : void ;
218+ function only ( name ?: string , fn ?: TestFn ) : void ;
219+ function only ( options ?: TestOptions , fn ?: TestFn ) : void ;
220+ function only ( fn ?: TestFn ) : void ;
189221 }
222+ /**
223+ * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
224+ * @since v20.2.0
225+ */
226+ function skip ( name ?: string , options ?: TestOptions , fn ?: TestFn ) : void ;
227+ function skip ( name ?: string , fn ?: TestFn ) : void ;
228+ function skip ( options ?: TestOptions , fn ?: TestFn ) : void ;
229+ function skip ( fn ?: TestFn ) : void ;
230+ /**
231+ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
232+ * @since v20.2.0
233+ */
234+ function todo ( name ?: string , options ?: TestOptions , fn ?: TestFn ) : void ;
235+ function todo ( name ?: string , fn ?: TestFn ) : void ;
236+ function todo ( options ?: TestOptions , fn ?: TestFn ) : void ;
237+ function todo ( fn ?: TestFn ) : void ;
238+ /**
239+ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
240+ * @since v20.2.0
241+ */
242+ function only ( name ?: string , options ?: TestOptions , fn ?: TestFn ) : void ;
243+ function only ( name ?: string , fn ?: TestFn ) : void ;
244+ function only ( options ?: TestOptions , fn ?: TestFn ) : void ;
245+ function only ( fn ?: TestFn ) : void ;
190246 /**
191247 * The type of a function under test. The first argument to this function is a
192248 * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
@@ -988,5 +1044,5 @@ declare module 'node:test' {
9881044 */
9891045 restore ( ) : void ;
9901046 }
991- export { test as default , run , test , describe , it , before , after , beforeEach , afterEach , mock } ;
1047+ export { test as default , run , test , describe , it , before , after , beforeEach , afterEach , mock , skip , only , todo } ;
9921048}
0 commit comments