diff --git a/types/node/test.d.ts b/types/node/test.d.ts index 614f94d5099aeab..3d1cb9ce914252b 100644 --- a/types/node/test.d.ts +++ b/types/node/test.d.ts @@ -171,21 +171,21 @@ declare module 'node:test' { * The `it()` function is imported from the `node:test` module. * @since v18.6.0, v16.17.0 */ - function it(name?: string, options?: TestOptions, fn?: ItFn): void; - function it(name?: string, fn?: ItFn): void; - function it(options?: TestOptions, fn?: ItFn): void; - function it(fn?: ItFn): void; + function it(name?: string, options?: TestOptions, fn?: TestFn): void; + function it(name?: string, fn?: TestFn): void; + function it(options?: TestOptions, fn?: TestFn): void; + function it(fn?: TestFn): void; namespace it { // Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. - function skip(name?: string, options?: TestOptions, fn?: ItFn): void; - function skip(name?: string, fn?: ItFn): void; - function skip(options?: TestOptions, fn?: ItFn): void; - function skip(fn?: ItFn): void; + function skip(name?: string, options?: TestOptions, fn?: TestFn): void; + function skip(name?: string, fn?: TestFn): void; + function skip(options?: TestOptions, fn?: TestFn): void; + function skip(fn?: TestFn): void; // Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. - function todo(name?: string, options?: TestOptions, fn?: ItFn): void; - function todo(name?: string, fn?: ItFn): void; - function todo(options?: TestOptions, fn?: ItFn): void; - function todo(fn?: ItFn): void; + function todo(name?: string, options?: TestOptions, fn?: TestFn): void; + function todo(name?: string, fn?: TestFn): void; + function todo(options?: TestOptions, fn?: TestFn): void; + function todo(fn?: TestFn): void; } /** * The type of a function under test. The first argument to this function is a @@ -198,11 +198,6 @@ declare module 'node:test' { * If the test uses callbacks, the callback function is passed as an argument */ type SuiteFn = (done: (result?: any) => void) => void; - /** - * The type of a function under test. - * If the test uses callbacks, the callback function is passed as an argument - */ - type ItFn = (done: (result?: any) => void) => any; interface RunOptions { /** * If a number is provided, then that many files would run in parallel. diff --git a/types/node/v18/test.d.ts b/types/node/v18/test.d.ts index b8c8e9c66ddd948..0196cbc10f72fc8 100644 --- a/types/node/v18/test.d.ts +++ b/types/node/v18/test.d.ts @@ -83,22 +83,22 @@ declare module 'node:test' { * @param fn The function under test. If the test uses callbacks, the callback function is * passed as the second argument. Default: A no-op function. */ - function it(name?: string, options?: TestOptions, fn?: ItFn): void; - function it(name?: string, fn?: ItFn): void; - function it(options?: TestOptions, fn?: ItFn): void; - function it(fn?: ItFn): void; + function it(name?: string, options?: TestOptions, fn?: TestFn): void; + function it(name?: string, fn?: TestFn): void; + function it(options?: TestOptions, fn?: TestFn): void; + function it(fn?: TestFn): void; namespace it { // Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. - function skip(name?: string, options?: TestOptions, fn?: ItFn): void; - function skip(name?: string, fn?: ItFn): void; - function skip(options?: TestOptions, fn?: ItFn): void; - function skip(fn?: ItFn): void; + function skip(name?: string, options?: TestOptions, fn?: TestFn): void; + function skip(name?: string, fn?: TestFn): void; + function skip(options?: TestOptions, fn?: TestFn): void; + function skip(fn?: TestFn): void; // Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. - function todo(name?: string, options?: TestOptions, fn?: ItFn): void; - function todo(name?: string, fn?: ItFn): void; - function todo(options?: TestOptions, fn?: ItFn): void; - function todo(fn?: ItFn): void; + function todo(name?: string, options?: TestOptions, fn?: TestFn): void; + function todo(name?: string, fn?: TestFn): void; + function todo(options?: TestOptions, fn?: TestFn): void; + function todo(fn?: TestFn): void; } /** @@ -114,12 +114,6 @@ declare module 'node:test' { */ type SuiteFn = (done: (result?: any) => void) => void; - /** - * The type of a function under test. - * If the test uses callbacks, the callback function is passed as an argument - */ - type ItFn = (done: (result?: any) => void) => any; - interface RunOptions { /** * If a number is provided, then that many files would run in parallel.