Skip to content

Commit feff7c4

Browse files
committed
1 parent 7ce9fe8 commit feff7c4

File tree

2 files changed

+24
-35
lines changed

2 files changed

+24
-35
lines changed

types/node/test.d.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,21 @@ declare module 'node:test' {
171171
* The `it()` function is imported from the `node:test` module.
172172
* @since v18.6.0, v16.17.0
173173
*/
174-
function it(name?: string, options?: TestOptions, fn?: ItFn): void;
175-
function it(name?: string, fn?: ItFn): void;
176-
function it(options?: TestOptions, fn?: ItFn): void;
177-
function it(fn?: ItFn): void;
174+
function it(name?: string, options?: TestOptions, fn?: TestFn): void;
175+
function it(name?: string, fn?: TestFn): void;
176+
function it(options?: TestOptions, fn?: TestFn): void;
177+
function it(fn?: TestFn): void;
178178
namespace it {
179179
// Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
180-
function skip(name?: string, options?: TestOptions, fn?: ItFn): void;
181-
function skip(name?: string, fn?: ItFn): void;
182-
function skip(options?: TestOptions, fn?: ItFn): void;
183-
function skip(fn?: ItFn): void;
180+
function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
181+
function skip(name?: string, fn?: TestFn): void;
182+
function skip(options?: TestOptions, fn?: TestFn): void;
183+
function skip(fn?: TestFn): void;
184184
// Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
185-
function todo(name?: string, options?: TestOptions, fn?: ItFn): void;
186-
function todo(name?: string, fn?: ItFn): void;
187-
function todo(options?: TestOptions, fn?: ItFn): void;
188-
function todo(fn?: ItFn): void;
185+
function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
186+
function todo(name?: string, fn?: TestFn): void;
187+
function todo(options?: TestOptions, fn?: TestFn): void;
188+
function todo(fn?: TestFn): void;
189189
}
190190
/**
191191
* The type of a function under test. The first argument to this function is a
@@ -198,11 +198,6 @@ declare module 'node:test' {
198198
* If the test uses callbacks, the callback function is passed as an argument
199199
*/
200200
type SuiteFn = (done: (result?: any) => void) => void;
201-
/**
202-
* The type of a function under test.
203-
* If the test uses callbacks, the callback function is passed as an argument
204-
*/
205-
type ItFn = (done: (result?: any) => void) => any;
206201
interface RunOptions {
207202
/**
208203
* If a number is provided, then that many files would run in parallel.

types/node/v18/test.d.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ declare module 'node:test' {
8383
* @param fn The function under test. If the test uses callbacks, the callback function is
8484
* passed as the second argument. Default: A no-op function.
8585
*/
86-
function it(name?: string, options?: TestOptions, fn?: ItFn): void;
87-
function it(name?: string, fn?: ItFn): void;
88-
function it(options?: TestOptions, fn?: ItFn): void;
89-
function it(fn?: ItFn): void;
86+
function it(name?: string, options?: TestOptions, fn?: TestFn): void;
87+
function it(name?: string, fn?: TestFn): void;
88+
function it(options?: TestOptions, fn?: TestFn): void;
89+
function it(fn?: TestFn): void;
9090
namespace it {
9191
// Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
92-
function skip(name?: string, options?: TestOptions, fn?: ItFn): void;
93-
function skip(name?: string, fn?: ItFn): void;
94-
function skip(options?: TestOptions, fn?: ItFn): void;
95-
function skip(fn?: ItFn): void;
92+
function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
93+
function skip(name?: string, fn?: TestFn): void;
94+
function skip(options?: TestOptions, fn?: TestFn): void;
95+
function skip(fn?: TestFn): void;
9696

9797
// Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
98-
function todo(name?: string, options?: TestOptions, fn?: ItFn): void;
99-
function todo(name?: string, fn?: ItFn): void;
100-
function todo(options?: TestOptions, fn?: ItFn): void;
101-
function todo(fn?: ItFn): void;
98+
function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
99+
function todo(name?: string, fn?: TestFn): void;
100+
function todo(options?: TestOptions, fn?: TestFn): void;
101+
function todo(fn?: TestFn): void;
102102
}
103103

104104
/**
@@ -114,12 +114,6 @@ declare module 'node:test' {
114114
*/
115115
type SuiteFn = (done: (result?: any) => void) => void;
116116

117-
/**
118-
* The type of a function under test.
119-
* If the test uses callbacks, the callback function is passed as an argument
120-
*/
121-
type ItFn = (done: (result?: any) => void) => any;
122-
123117
interface RunOptions {
124118
/**
125119
* If a number is provided, then that many files would run in parallel.

0 commit comments

Comments
 (0)