@types/node 18.8.1 → 18.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node/README.md +1 -1
- node/package.json +2 -2
- node/ts4.8/test.d.ts +129 -5
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 04 Oct 2022 15:32:57 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
|
|
14
14
|
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "18.8.
|
|
3
|
+
"version": "18.8.2",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -227,6 +227,6 @@
|
|
|
227
227
|
},
|
|
228
228
|
"scripts": {},
|
|
229
229
|
"dependencies": {},
|
|
230
|
-
"typesPublisherContentHash": "
|
|
230
|
+
"typesPublisherContentHash": "034172ea945b66afc6502e6be34d6fb957c596091e39cf43672e8aca563a8c66",
|
|
231
231
|
"typeScriptVersion": "4.1"
|
|
232
232
|
}
|
node/ts4.8/test.d.ts
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/test.js)
|
|
4
4
|
*/
|
|
5
5
|
declare module 'node:test' {
|
|
6
|
+
/**
|
|
7
|
+
* Programmatically start the test runner.
|
|
8
|
+
* @since v18.9.0
|
|
9
|
+
* @param options Configuration options for running tests.
|
|
10
|
+
* @returns A {@link TapStream} that emits events about the test execution.
|
|
11
|
+
*/
|
|
12
|
+
function run(options?: RunOptions): TapStream;
|
|
13
|
+
|
|
6
14
|
/**
|
|
7
15
|
* The `test()` function is the value imported from the test module. Each invocation of this
|
|
8
16
|
* function results in the creation of a test point in the TAP output.
|
|
@@ -42,7 +50,7 @@ declare module 'node:test' {
|
|
|
42
50
|
function test(options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
43
51
|
function test(fn?: TestFn): Promise<void>;
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
/**
|
|
46
54
|
* @since v18.6.0
|
|
47
55
|
* @param name The name of the suite, which is displayed when reporting suite results.
|
|
48
56
|
* Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
|
|
@@ -54,7 +62,7 @@ declare module 'node:test' {
|
|
|
54
62
|
function describe(options?: TestOptions, fn?: SuiteFn): void;
|
|
55
63
|
function describe(fn?: SuiteFn): void;
|
|
56
64
|
|
|
57
|
-
|
|
65
|
+
/**
|
|
58
66
|
* @since v18.6.0
|
|
59
67
|
* @param name The name of the test, which is displayed when reporting test results.
|
|
60
68
|
* Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
|
|
@@ -86,6 +94,122 @@ declare module 'node:test' {
|
|
|
86
94
|
*/
|
|
87
95
|
type ItFn = (done: (result?: any) => void) => any;
|
|
88
96
|
|
|
97
|
+
interface RunOptions {
|
|
98
|
+
/**
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
concurrency?: number | boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* An array containing the list of files to run. If unspecified, the test runner execution model will be used.
|
|
105
|
+
*/
|
|
106
|
+
files?: readonly string[];
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Allows aborting an in-progress test.
|
|
110
|
+
* @default undefined
|
|
111
|
+
*/
|
|
112
|
+
signal?: AbortSignal;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
|
|
116
|
+
* value from their parent.
|
|
117
|
+
* @default Infinity
|
|
118
|
+
*/
|
|
119
|
+
timeout?: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* A successful call of the run() method will return a new TapStream object, streaming a TAP output.
|
|
124
|
+
* TapStream will emit events in the order of the tests' definitions.
|
|
125
|
+
* @since v18.9.0
|
|
126
|
+
*/
|
|
127
|
+
interface TapStream extends NodeJS.ReadableStream {
|
|
128
|
+
addListener(event: 'test:diagnostic', listener: (message: string) => void): this;
|
|
129
|
+
addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
|
|
130
|
+
addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
|
|
131
|
+
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
132
|
+
emit(event: 'test:diagnostic', message: string): boolean;
|
|
133
|
+
emit(event: 'test:fail', data: TestFail): boolean;
|
|
134
|
+
emit(event: 'test:pass', data: TestPass): boolean;
|
|
135
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
136
|
+
on(event: 'test:diagnostic', listener: (message: string) => void): this;
|
|
137
|
+
on(event: 'test:fail', listener: (data: TestFail) => void): this;
|
|
138
|
+
on(event: 'test:pass', listener: (data: TestPass) => void): this;
|
|
139
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
140
|
+
once(event: 'test:diagnostic', listener: (message: string) => void): this;
|
|
141
|
+
once(event: 'test:fail', listener: (data: TestFail) => void): this;
|
|
142
|
+
once(event: 'test:pass', listener: (data: TestPass) => void): this;
|
|
143
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
144
|
+
prependListener(event: 'test:diagnostic', listener: (message: string) => void): this;
|
|
145
|
+
prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
|
|
146
|
+
prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
|
|
147
|
+
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
148
|
+
prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this;
|
|
149
|
+
prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
|
|
150
|
+
prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
|
|
151
|
+
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface TestFail {
|
|
155
|
+
/**
|
|
156
|
+
* The test duration.
|
|
157
|
+
*/
|
|
158
|
+
duration: number;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The failure casing test to fail.
|
|
162
|
+
*/
|
|
163
|
+
error: Error;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The test name.
|
|
167
|
+
*/
|
|
168
|
+
name: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The ordinal number of the test.
|
|
172
|
+
*/
|
|
173
|
+
testNumber: number;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Present if `context.todo` is called.
|
|
177
|
+
*/
|
|
178
|
+
todo?: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Present if `context.skip` is called.
|
|
182
|
+
*/
|
|
183
|
+
skip?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface TestPass {
|
|
187
|
+
/**
|
|
188
|
+
* The test duration.
|
|
189
|
+
*/
|
|
190
|
+
duration: number;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The test name.
|
|
194
|
+
*/
|
|
195
|
+
name: string;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The ordinal number of the test.
|
|
199
|
+
*/
|
|
200
|
+
testNumber: number;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Present if `context.todo` is called.
|
|
204
|
+
*/
|
|
205
|
+
todo?: string;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Present if `context.skip` is called.
|
|
209
|
+
*/
|
|
210
|
+
skip?: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
89
213
|
/**
|
|
90
214
|
* An instance of `TestContext` is passed to each test function in order to interact with the
|
|
91
215
|
* test runner. However, the `TestContext` constructor is not exposed as part of the API.
|
|
@@ -159,7 +283,7 @@ declare module 'node:test' {
|
|
|
159
283
|
|
|
160
284
|
/**
|
|
161
285
|
* Allows aborting an in-progress test.
|
|
162
|
-
* @since 8.
|
|
286
|
+
* @since v18.8.0
|
|
163
287
|
*/
|
|
164
288
|
signal?: AbortSignal;
|
|
165
289
|
|
|
@@ -174,7 +298,7 @@ declare module 'node:test' {
|
|
|
174
298
|
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
|
|
175
299
|
* value from their parent.
|
|
176
300
|
* @default Infinity
|
|
177
|
-
* @since
|
|
301
|
+
* @since v18.7.0
|
|
178
302
|
*/
|
|
179
303
|
timeout?: number;
|
|
180
304
|
|
|
@@ -186,5 +310,5 @@ declare module 'node:test' {
|
|
|
186
310
|
todo?: boolean | string;
|
|
187
311
|
}
|
|
188
312
|
|
|
189
|
-
export { test as default, test, describe, it };
|
|
313
|
+
export { test as default, run, test, describe, it };
|
|
190
314
|
}
|