@@ -135,6 +135,22 @@ declare module 'node:test' {
135
135
function test ( name ?: string , options ?: TestOptions , fn ?: TestFn ) : Promise < void > ;
136
136
function test ( options ?: TestOptions , fn ?: TestFn ) : Promise < void > ;
137
137
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
+ }
138
154
/**
139
155
* The `describe()` function imported from the `node:test` module. Each
140
156
* invocation of this function results in the creation of a Subtest.
@@ -164,6 +180,14 @@ declare module 'node:test' {
164
180
function todo ( name ?: string , fn ?: SuiteFn ) : void ;
165
181
function todo ( options ?: TestOptions , fn ?: SuiteFn ) : void ;
166
182
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 ;
167
191
}
168
192
/**
169
193
* Shorthand for `test()`.
@@ -186,7 +210,39 @@ declare module 'node:test' {
186
210
function todo ( name ?: string , fn ?: TestFn ) : void ;
187
211
function todo ( options ?: TestOptions , fn ?: TestFn ) : void ;
188
212
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 ;
189
221
}
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 ;
190
246
/**
191
247
* The type of a function under test. The first argument to this function is a
192
248
* {@link TestContext} object. If the test uses callbacks, the callback function is passed as
@@ -988,5 +1044,5 @@ declare module 'node:test' {
988
1044
*/
989
1045
restore ( ) : void ;
990
1046
}
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 } ;
992
1048
}
0 commit comments