@types/node 20.12.13 → 20.12.14
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/assert.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +1 -1
- node/child_process.d.ts +29 -31
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +1 -2
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +1 -10
- node/dns/promises.d.ts +6 -7
- node/dns.d.ts +12 -23
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -22
- node/fs.d.ts +2 -3
- node/http.d.ts +43 -62
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/inspector.d.ts +1 -1
- node/net.d.ts +4 -7
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +45 -305
- node/process.d.ts +4 -11
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +51 -291
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +3 -11
- node/util.d.ts +4 -20
- node/v8.d.ts +1 -45
- node/vm.d.ts +6 -9
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/string_decoder.d.ts
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
* decoder.write(Buffer.from([0x82]));
|
37
37
|
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
|
38
38
|
* ```
|
39
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
39
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/string_decoder.js)
|
40
40
|
*/
|
41
41
|
declare module "string_decoder" {
|
42
42
|
class StringDecoder {
|
node/test.d.ts
CHANGED
@@ -76,7 +76,7 @@
|
|
76
76
|
*
|
77
77
|
* If any tests fail, the process exit code is set to `1`.
|
78
78
|
* @since v18.0.0, v16.17.0
|
79
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
79
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/test.js)
|
80
80
|
*/
|
81
81
|
declare module "node:test" {
|
82
82
|
import { Readable } from "node:stream";
|
@@ -110,7 +110,7 @@ declare module "node:test" {
|
|
110
110
|
* additional diagnostic information, or creating subtests.
|
111
111
|
*
|
112
112
|
* `test()` returns a `Promise` that fulfills once the test completes.
|
113
|
-
* if `test()` is called within a
|
113
|
+
* if `test()` is called within a `describe()` block, it fulfills immediately.
|
114
114
|
* The return value can usually be discarded for top level tests.
|
115
115
|
* However, the return value from subtests should be used to prevent the parent
|
116
116
|
* test from finishing first and cancelling the subtest
|
@@ -137,7 +137,7 @@ declare module "node:test" {
|
|
137
137
|
* @param options Configuration options for the test. The following properties are supported:
|
138
138
|
* @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the
|
139
139
|
* callback function is passed as the second argument.
|
140
|
-
* @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within
|
140
|
+
* @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within {@link describe}.
|
141
141
|
*/
|
142
142
|
function test(name?: string, fn?: TestFn): Promise<void>;
|
143
143
|
function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
@@ -147,47 +147,14 @@ declare module "node:test" {
|
|
147
147
|
export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
|
148
148
|
}
|
149
149
|
/**
|
150
|
-
* The `
|
151
|
-
*
|
152
|
-
*
|
153
|
-
*
|
150
|
+
* The `describe()` function imported from the `node:test` module. Each
|
151
|
+
* invocation of this function results in the creation of a Subtest.
|
152
|
+
* After invocation of top level `describe` functions,
|
153
|
+
* all top level tests and suites will execute.
|
154
|
+
* @param [name='The name'] The name of the suite, which is displayed when reporting test results.
|
155
|
+
* @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`.
|
156
|
+
* @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object.
|
154
157
|
* @return Immediately fulfilled with `undefined`.
|
155
|
-
* @since v20.13.0
|
156
|
-
*/
|
157
|
-
function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
158
|
-
function suite(name?: string, fn?: SuiteFn): Promise<void>;
|
159
|
-
function suite(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
160
|
-
function suite(fn?: SuiteFn): Promise<void>;
|
161
|
-
namespace suite {
|
162
|
-
/**
|
163
|
-
* Shorthand for skipping a suite. This is the same as [`suite([name], { skip: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#suitename-options-fn).
|
164
|
-
* @since v20.13.0
|
165
|
-
*/
|
166
|
-
function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
167
|
-
function skip(name?: string, fn?: SuiteFn): Promise<void>;
|
168
|
-
function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
169
|
-
function skip(fn?: SuiteFn): Promise<void>;
|
170
|
-
/**
|
171
|
-
* Shorthand for marking a suite as `TODO`. This is the same as [`suite([name], { todo: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#suitename-options-fn).
|
172
|
-
* @since v20.13.0
|
173
|
-
*/
|
174
|
-
function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
175
|
-
function todo(name?: string, fn?: SuiteFn): Promise<void>;
|
176
|
-
function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
177
|
-
function todo(fn?: SuiteFn): Promise<void>;
|
178
|
-
/**
|
179
|
-
* Shorthand for marking a suite as `only`. This is the same as [`suite([name], { only: true }[, fn])`](https://nodejs.org/docs/latest-v20.x/api/test.html#suitename-options-fn).
|
180
|
-
* @since v20.13.0
|
181
|
-
*/
|
182
|
-
function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
183
|
-
function only(name?: string, fn?: SuiteFn): Promise<void>;
|
184
|
-
function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
185
|
-
function only(fn?: SuiteFn): Promise<void>;
|
186
|
-
}
|
187
|
-
/**
|
188
|
-
* Alias for `{@link suite}`.
|
189
|
-
*
|
190
|
-
* The `describe()` function is imported from the `node:test` module.
|
191
158
|
*/
|
192
159
|
function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
193
160
|
function describe(name?: string, fn?: SuiteFn): Promise<void>;
|
@@ -195,23 +162,21 @@ declare module "node:test" {
|
|
195
162
|
function describe(fn?: SuiteFn): Promise<void>;
|
196
163
|
namespace describe {
|
197
164
|
/**
|
198
|
-
* Shorthand for skipping a suite
|
199
|
-
* @since v18.15.0
|
165
|
+
* Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
|
200
166
|
*/
|
201
167
|
function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
202
168
|
function skip(name?: string, fn?: SuiteFn): Promise<void>;
|
203
169
|
function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
204
170
|
function skip(fn?: SuiteFn): Promise<void>;
|
205
171
|
/**
|
206
|
-
* Shorthand for marking a suite as `TODO
|
207
|
-
* @since v18.15.0
|
172
|
+
* Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`.
|
208
173
|
*/
|
209
174
|
function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
210
175
|
function todo(name?: string, fn?: SuiteFn): Promise<void>;
|
211
176
|
function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
212
177
|
function todo(fn?: SuiteFn): Promise<void>;
|
213
178
|
/**
|
214
|
-
* Shorthand for marking a suite as `only
|
179
|
+
* Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
|
215
180
|
* @since v18.15.0
|
216
181
|
*/
|
217
182
|
function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
@@ -220,7 +185,7 @@ declare module "node:test" {
|
|
220
185
|
function only(fn?: SuiteFn): Promise<void>;
|
221
186
|
}
|
222
187
|
/**
|
223
|
-
*
|
188
|
+
* Shorthand for `test()`.
|
224
189
|
*
|
225
190
|
* The `it()` function is imported from the `node:test` module.
|
226
191
|
* @since v18.6.0, v16.17.0
|
@@ -365,16 +330,10 @@ declare module "node:test" {
|
|
365
330
|
/**
|
366
331
|
* A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests. `TestsStream` will emit events, in the
|
367
332
|
* order of the tests definition
|
368
|
-
*
|
369
|
-
* Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute.
|
370
333
|
* @since v18.9.0, v16.19.0
|
371
334
|
*/
|
372
335
|
class TestsStream extends Readable implements NodeJS.ReadableStream {
|
373
|
-
addListener(event: "test:coverage", listener: (data: TestCoverage) => void): this;
|
374
|
-
addListener(event: "test:complete", listener: (data: TestComplete) => void): this;
|
375
|
-
addListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
|
376
336
|
addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
377
|
-
addListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
|
378
337
|
addListener(event: "test:fail", listener: (data: TestFail) => void): this;
|
379
338
|
addListener(event: "test:pass", listener: (data: TestPass) => void): this;
|
380
339
|
addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
|
@@ -382,11 +341,7 @@ declare module "node:test" {
|
|
382
341
|
addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
383
342
|
addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
384
343
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
385
|
-
emit(event: "test:coverage", data: TestCoverage): boolean;
|
386
|
-
emit(event: "test:complete", data: TestComplete): boolean;
|
387
|
-
emit(event: "test:dequeue", data: TestDequeue): boolean;
|
388
344
|
emit(event: "test:diagnostic", data: DiagnosticData): boolean;
|
389
|
-
emit(event: "test:enqueue", data: TestEnqueue): boolean;
|
390
345
|
emit(event: "test:fail", data: TestFail): boolean;
|
391
346
|
emit(event: "test:pass", data: TestPass): boolean;
|
392
347
|
emit(event: "test:plan", data: TestPlan): boolean;
|
@@ -394,11 +349,7 @@ declare module "node:test" {
|
|
394
349
|
emit(event: "test:stderr", data: TestStderr): boolean;
|
395
350
|
emit(event: "test:stdout", data: TestStdout): boolean;
|
396
351
|
emit(event: string | symbol, ...args: any[]): boolean;
|
397
|
-
on(event: "test:coverage", listener: (data: TestCoverage) => void): this;
|
398
|
-
on(event: "test:complete", listener: (data: TestComplete) => void): this;
|
399
|
-
on(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
|
400
352
|
on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
401
|
-
on(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
|
402
353
|
on(event: "test:fail", listener: (data: TestFail) => void): this;
|
403
354
|
on(event: "test:pass", listener: (data: TestPass) => void): this;
|
404
355
|
on(event: "test:plan", listener: (data: TestPlan) => void): this;
|
@@ -406,11 +357,7 @@ declare module "node:test" {
|
|
406
357
|
on(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
407
358
|
on(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
408
359
|
on(event: string, listener: (...args: any[]) => void): this;
|
409
|
-
once(event: "test:coverage", listener: (data: TestCoverage) => void): this;
|
410
|
-
once(event: "test:complete", listener: (data: TestComplete) => void): this;
|
411
|
-
once(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
|
412
360
|
once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
413
|
-
once(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
|
414
361
|
once(event: "test:fail", listener: (data: TestFail) => void): this;
|
415
362
|
once(event: "test:pass", listener: (data: TestPass) => void): this;
|
416
363
|
once(event: "test:plan", listener: (data: TestPlan) => void): this;
|
@@ -418,11 +365,7 @@ declare module "node:test" {
|
|
418
365
|
once(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
419
366
|
once(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
420
367
|
once(event: string, listener: (...args: any[]) => void): this;
|
421
|
-
prependListener(event: "test:coverage", listener: (data: TestCoverage) => void): this;
|
422
|
-
prependListener(event: "test:complete", listener: (data: TestComplete) => void): this;
|
423
|
-
prependListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
|
424
368
|
prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
425
|
-
prependListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
|
426
369
|
prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
|
427
370
|
prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
|
428
371
|
prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
|
@@ -430,11 +373,7 @@ declare module "node:test" {
|
|
430
373
|
prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
431
374
|
prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
432
375
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
433
|
-
prependOnceListener(event: "test:coverage", listener: (data: TestCoverage) => void): this;
|
434
|
-
prependOnceListener(event: "test:complete", listener: (data: TestComplete) => void): this;
|
435
|
-
prependOnceListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
|
436
376
|
prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
437
|
-
prependOnceListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
|
438
377
|
prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
|
439
378
|
prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
|
440
379
|
prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
|
@@ -639,7 +578,7 @@ declare module "node:test" {
|
|
639
578
|
todo?: boolean | string | undefined;
|
640
579
|
}
|
641
580
|
/**
|
642
|
-
* This function
|
581
|
+
* This function is used to create a hook running before running a suite.
|
643
582
|
*
|
644
583
|
* ```js
|
645
584
|
* describe('tests', async () => {
|
@@ -655,7 +594,7 @@ declare module "node:test" {
|
|
655
594
|
*/
|
656
595
|
function before(fn?: HookFn, options?: HookOptions): void;
|
657
596
|
/**
|
658
|
-
* This function
|
597
|
+
* This function is used to create a hook running after running a suite.
|
659
598
|
*
|
660
599
|
* ```js
|
661
600
|
* describe('tests', async () => {
|
@@ -671,7 +610,8 @@ declare module "node:test" {
|
|
671
610
|
*/
|
672
611
|
function after(fn?: HookFn, options?: HookOptions): void;
|
673
612
|
/**
|
674
|
-
* This function
|
613
|
+
* This function is used to create a hook running
|
614
|
+
* before each subtest of the current suite.
|
675
615
|
*
|
676
616
|
* ```js
|
677
617
|
* describe('tests', async () => {
|
@@ -687,8 +627,8 @@ declare module "node:test" {
|
|
687
627
|
*/
|
688
628
|
function beforeEach(fn?: HookFn, options?: HookOptions): void;
|
689
629
|
/**
|
690
|
-
* This function
|
691
|
-
*
|
630
|
+
* This function is used to create a hook running
|
631
|
+
* after each subtest of the current test.
|
692
632
|
*
|
693
633
|
* ```js
|
694
634
|
* describe('tests', async () => {
|
@@ -1322,11 +1262,12 @@ interface TestLocationInfo {
|
|
1322
1262
|
*/
|
1323
1263
|
column?: number;
|
1324
1264
|
/**
|
1325
|
-
* The path of the test file, `undefined` if test
|
1265
|
+
* The path of the test file, `undefined` if test is not ran through a file.
|
1326
1266
|
*/
|
1327
1267
|
file?: string;
|
1328
1268
|
/**
|
1329
|
-
* The line number where the test is defined, or
|
1269
|
+
* The line number where the test is defined, or
|
1270
|
+
* `undefined` if the test was run through the REPL.
|
1330
1271
|
*/
|
1331
1272
|
line?: number;
|
1332
1273
|
}
|
@@ -1340,202 +1281,6 @@ interface DiagnosticData extends TestLocationInfo {
|
|
1340
1281
|
*/
|
1341
1282
|
nesting: number;
|
1342
1283
|
}
|
1343
|
-
interface TestCoverage {
|
1344
|
-
/**
|
1345
|
-
* An object containing the coverage report.
|
1346
|
-
*/
|
1347
|
-
summary: {
|
1348
|
-
/**
|
1349
|
-
* An array of coverage reports for individual files. Each report is an object with the following schema:
|
1350
|
-
*/
|
1351
|
-
files: Array<{
|
1352
|
-
/**
|
1353
|
-
* The absolute path of the file.
|
1354
|
-
*/
|
1355
|
-
path: string;
|
1356
|
-
/**
|
1357
|
-
* The total number of lines.
|
1358
|
-
*/
|
1359
|
-
totalLineCount: number;
|
1360
|
-
/**
|
1361
|
-
* The total number of branches.
|
1362
|
-
*/
|
1363
|
-
totalBranchCount: number;
|
1364
|
-
/**
|
1365
|
-
* The total number of functions.
|
1366
|
-
*/
|
1367
|
-
totalFunctionCount: number;
|
1368
|
-
/**
|
1369
|
-
* The number of covered lines.
|
1370
|
-
*/
|
1371
|
-
coveredLineCount: number;
|
1372
|
-
/**
|
1373
|
-
* The number of covered branches.
|
1374
|
-
*/
|
1375
|
-
coveredBranchCount: number;
|
1376
|
-
/**
|
1377
|
-
* The number of covered functions.
|
1378
|
-
*/
|
1379
|
-
coveredFunctionCount: number;
|
1380
|
-
/**
|
1381
|
-
* The percentage of lines covered.
|
1382
|
-
*/
|
1383
|
-
coveredLinePercent: number;
|
1384
|
-
/**
|
1385
|
-
* The percentage of branches covered.
|
1386
|
-
*/
|
1387
|
-
coveredBranchPercent: number;
|
1388
|
-
/**
|
1389
|
-
* The percentage of functions covered.
|
1390
|
-
*/
|
1391
|
-
coveredFunctionPercent: number;
|
1392
|
-
/**
|
1393
|
-
* An array of functions representing function coverage.
|
1394
|
-
*/
|
1395
|
-
functions: Array<{
|
1396
|
-
/**
|
1397
|
-
* The name of the function.
|
1398
|
-
*/
|
1399
|
-
name: string;
|
1400
|
-
/**
|
1401
|
-
* The line number where the function is defined.
|
1402
|
-
*/
|
1403
|
-
line: number;
|
1404
|
-
/**
|
1405
|
-
* The number of times the function was called.
|
1406
|
-
*/
|
1407
|
-
count: number;
|
1408
|
-
}>;
|
1409
|
-
/**
|
1410
|
-
* An array of lines representing line numbers and the number of times they were covered.
|
1411
|
-
*/
|
1412
|
-
lines: Array<{
|
1413
|
-
/**
|
1414
|
-
* The line number.
|
1415
|
-
*/
|
1416
|
-
line: number;
|
1417
|
-
/**
|
1418
|
-
* The number of times the line was covered.
|
1419
|
-
*/
|
1420
|
-
count: number;
|
1421
|
-
}>;
|
1422
|
-
}>;
|
1423
|
-
/**
|
1424
|
-
* An object containing a summary of coverage for all files.
|
1425
|
-
*/
|
1426
|
-
totals: {
|
1427
|
-
/**
|
1428
|
-
* The total number of lines.
|
1429
|
-
*/
|
1430
|
-
totalLineCount: number;
|
1431
|
-
/**
|
1432
|
-
* The total number of branches.
|
1433
|
-
*/
|
1434
|
-
totalBranchCount: number;
|
1435
|
-
/**
|
1436
|
-
* The total number of functions.
|
1437
|
-
*/
|
1438
|
-
totalFunctionCount: number;
|
1439
|
-
/**
|
1440
|
-
* The number of covered lines.
|
1441
|
-
*/
|
1442
|
-
coveredLineCount: number;
|
1443
|
-
/**
|
1444
|
-
* The number of covered branches.
|
1445
|
-
*/
|
1446
|
-
coveredBranchCount: number;
|
1447
|
-
/**
|
1448
|
-
* The number of covered functions.
|
1449
|
-
*/
|
1450
|
-
coveredFunctionCount: number;
|
1451
|
-
/**
|
1452
|
-
* The percentage of lines covered.
|
1453
|
-
*/
|
1454
|
-
coveredLinePercent: number;
|
1455
|
-
/**
|
1456
|
-
* The percentage of branches covered.
|
1457
|
-
*/
|
1458
|
-
coveredBranchPercent: number;
|
1459
|
-
/**
|
1460
|
-
* The percentage of functions covered.
|
1461
|
-
*/
|
1462
|
-
coveredFunctionPercent: number;
|
1463
|
-
};
|
1464
|
-
/**
|
1465
|
-
* The working directory when code coverage began. This
|
1466
|
-
* is useful for displaying relative path names in case
|
1467
|
-
* the tests changed the working directory of the Node.js process.
|
1468
|
-
*/
|
1469
|
-
workingDirectory: string;
|
1470
|
-
};
|
1471
|
-
/**
|
1472
|
-
* The nesting level of the test.
|
1473
|
-
*/
|
1474
|
-
nesting: number;
|
1475
|
-
}
|
1476
|
-
interface TestComplete extends TestLocationInfo {
|
1477
|
-
/**
|
1478
|
-
* Additional execution metadata.
|
1479
|
-
*/
|
1480
|
-
details: {
|
1481
|
-
/**
|
1482
|
-
* Whether the test passed or not.
|
1483
|
-
*/
|
1484
|
-
passed: boolean;
|
1485
|
-
/**
|
1486
|
-
* The duration of the test in milliseconds.
|
1487
|
-
*/
|
1488
|
-
duration_ms: number;
|
1489
|
-
/**
|
1490
|
-
* An error wrapping the error thrown by the test if it did not pass.
|
1491
|
-
*/
|
1492
|
-
error: Error;
|
1493
|
-
/**
|
1494
|
-
* The type of the test, used to denote whether this is a suite.
|
1495
|
-
*/
|
1496
|
-
type?: "suite";
|
1497
|
-
};
|
1498
|
-
/**
|
1499
|
-
* The test name.
|
1500
|
-
*/
|
1501
|
-
name: string;
|
1502
|
-
/**
|
1503
|
-
* The nesting level of the test.
|
1504
|
-
*/
|
1505
|
-
nesting: number;
|
1506
|
-
/**
|
1507
|
-
* The ordinal number of the test.
|
1508
|
-
*/
|
1509
|
-
testNumber: number;
|
1510
|
-
/**
|
1511
|
-
* Present if `context.todo` is called.
|
1512
|
-
*/
|
1513
|
-
todo?: string | boolean;
|
1514
|
-
/**
|
1515
|
-
* Present if `context.skip` is called.
|
1516
|
-
*/
|
1517
|
-
skip?: string | boolean;
|
1518
|
-
}
|
1519
|
-
interface TestDequeue extends TestLocationInfo {
|
1520
|
-
/**
|
1521
|
-
* The test name.
|
1522
|
-
*/
|
1523
|
-
name: string;
|
1524
|
-
/**
|
1525
|
-
* The nesting level of the test.
|
1526
|
-
*/
|
1527
|
-
nesting: number;
|
1528
|
-
}
|
1529
|
-
interface TestEnqueue extends TestLocationInfo {
|
1530
|
-
/**
|
1531
|
-
* The test name.
|
1532
|
-
*/
|
1533
|
-
name: string;
|
1534
|
-
/**
|
1535
|
-
* The nesting level of the test.
|
1536
|
-
*/
|
1537
|
-
nesting: number;
|
1538
|
-
}
|
1539
1284
|
interface TestFail extends TestLocationInfo {
|
1540
1285
|
/**
|
1541
1286
|
* Additional execution metadata.
|
@@ -1546,12 +1291,12 @@ interface TestFail extends TestLocationInfo {
|
|
1546
1291
|
*/
|
1547
1292
|
duration_ms: number;
|
1548
1293
|
/**
|
1549
|
-
*
|
1294
|
+
* The error thrown by the test.
|
1550
1295
|
*/
|
1551
1296
|
error: Error;
|
1552
1297
|
/**
|
1553
1298
|
* The type of the test, used to denote whether this is a suite.
|
1554
|
-
* @since
|
1299
|
+
* @since 20.0.0, 19.9.0, 18.17.0
|
1555
1300
|
*/
|
1556
1301
|
type?: "suite";
|
1557
1302
|
};
|
@@ -1634,16 +1379,36 @@ interface TestStart extends TestLocationInfo {
|
|
1634
1379
|
}
|
1635
1380
|
interface TestStderr extends TestLocationInfo {
|
1636
1381
|
/**
|
1637
|
-
* The message written to `stderr
|
1382
|
+
* The message written to `stderr`
|
1638
1383
|
*/
|
1639
1384
|
message: string;
|
1640
1385
|
}
|
1641
1386
|
interface TestStdout extends TestLocationInfo {
|
1642
1387
|
/**
|
1643
|
-
* The message written to `stdout
|
1388
|
+
* The message written to `stdout`
|
1644
1389
|
*/
|
1645
1390
|
message: string;
|
1646
1391
|
}
|
1392
|
+
interface TestEnqueue extends TestLocationInfo {
|
1393
|
+
/**
|
1394
|
+
* The test name
|
1395
|
+
*/
|
1396
|
+
name: string;
|
1397
|
+
/**
|
1398
|
+
* The nesting level of the test.
|
1399
|
+
*/
|
1400
|
+
nesting: number;
|
1401
|
+
}
|
1402
|
+
interface TestDequeue extends TestLocationInfo {
|
1403
|
+
/**
|
1404
|
+
* The test name
|
1405
|
+
*/
|
1406
|
+
name: string;
|
1407
|
+
/**
|
1408
|
+
* The nesting level of the test.
|
1409
|
+
*/
|
1410
|
+
nesting: number;
|
1411
|
+
}
|
1647
1412
|
|
1648
1413
|
/**
|
1649
1414
|
* The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
|
@@ -1660,23 +1425,21 @@ interface TestStdout extends TestLocationInfo {
|
|
1660
1425
|
* import test from 'test/reporters';
|
1661
1426
|
* ```
|
1662
1427
|
* @since v19.9.0
|
1663
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
1428
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/test/reporters.js)
|
1664
1429
|
*/
|
1665
1430
|
declare module "node:test/reporters" {
|
1666
1431
|
import { Transform, TransformOptions } from "node:stream";
|
1667
1432
|
|
1668
1433
|
type TestEvent =
|
1669
|
-
| { type: "test:coverage"; data: TestCoverage }
|
1670
|
-
| { type: "test:complete"; data: TestComplete }
|
1671
|
-
| { type: "test:dequeue"; data: TestDequeue }
|
1672
1434
|
| { type: "test:diagnostic"; data: DiagnosticData }
|
1673
|
-
| { type: "test:enqueue"; data: TestEnqueue }
|
1674
1435
|
| { type: "test:fail"; data: TestFail }
|
1675
1436
|
| { type: "test:pass"; data: TestPass }
|
1676
1437
|
| { type: "test:plan"; data: TestPlan }
|
1677
1438
|
| { type: "test:start"; data: TestStart }
|
1678
1439
|
| { type: "test:stderr"; data: TestStderr }
|
1679
1440
|
| { type: "test:stdout"; data: TestStdout }
|
1441
|
+
| { type: "test:enqueue"; data: TestEnqueue }
|
1442
|
+
| { type: "test:dequeue"; data: TestDequeue }
|
1680
1443
|
| { type: "test:watch:drained" };
|
1681
1444
|
type TestEventGenerator = AsyncGenerator<TestEvent, void>;
|
1682
1445
|
|
@@ -1697,12 +1460,9 @@ declare module "node:test/reporters" {
|
|
1697
1460
|
constructor();
|
1698
1461
|
}
|
1699
1462
|
/**
|
1700
|
-
* The `junit` reporter outputs test results in a jUnit XML format
|
1463
|
+
* The `junit` reporter outputs test results in a jUnit XML format
|
1701
1464
|
*/
|
1702
1465
|
function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
|
1703
|
-
/**
|
1704
|
-
* The `lcov` reporter outputs test coverage when used with the [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--experimental-test-coverage) flag.
|
1705
|
-
*/
|
1706
1466
|
class Lcov extends Transform {
|
1707
1467
|
constructor(opts?: TransformOptions);
|
1708
1468
|
}
|
node/timers.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* The timer functions within Node.js implement a similar API as the timers API
|
7
7
|
* provided by Web Browsers but use a different internal implementation that is
|
8
8
|
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/timers.js)
|
10
10
|
*/
|
11
11
|
declare module "timers" {
|
12
12
|
import { Abortable } from "node:events";
|
node/tls.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* ```js
|
7
7
|
* const tls = require('node:tls');
|
8
8
|
* ```
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/tls.js)
|
10
10
|
*/
|
11
11
|
declare module "tls" {
|
12
12
|
import { X509Certificate } from "node:crypto";
|
node/trace_events.d.ts
CHANGED
@@ -90,7 +90,7 @@
|
|
90
90
|
*
|
91
91
|
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html#class-worker) threads.
|
92
92
|
* @experimental
|
93
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
93
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/trace_events.js)
|
94
94
|
*/
|
95
95
|
declare module "trace_events" {
|
96
96
|
/**
|
node/tty.d.ts
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
*
|
22
22
|
* In most cases, there should be little to no reason for an application to
|
23
23
|
* manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
|
24
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
24
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/tty.js)
|
25
25
|
*/
|
26
26
|
declare module "tty" {
|
27
27
|
import * as net from "node:net";
|
node/url.d.ts
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
* ```js
|
6
6
|
* import url from 'node:url';
|
7
7
|
* ```
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/url.js)
|
9
9
|
*/
|
10
10
|
declare module "url" {
|
11
11
|
import { Blob as NodeBlob } from "node:buffer";
|
@@ -46,14 +46,6 @@ declare module "url" {
|
|
46
46
|
interface UrlWithStringQuery extends Url {
|
47
47
|
query: string | null;
|
48
48
|
}
|
49
|
-
interface FileUrlToPathOptions {
|
50
|
-
/**
|
51
|
-
* `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
|
52
|
-
* @default undefined
|
53
|
-
*/
|
54
|
-
windows?: boolean | undefined;
|
55
|
-
}
|
56
|
-
interface PathToFileUrlOptions extends FileUrlToPathOptions {}
|
57
49
|
/**
|
58
50
|
* The `url.parse()` method takes a URL string, parses it, and returns a URL
|
59
51
|
* object.
|
@@ -306,7 +298,7 @@ declare module "url" {
|
|
306
298
|
* @param url The file URL string or URL object to convert to a path.
|
307
299
|
* @return The fully-resolved platform-specific Node.js file path.
|
308
300
|
*/
|
309
|
-
function fileURLToPath(url: string | URL
|
301
|
+
function fileURLToPath(url: string | URL): string;
|
310
302
|
/**
|
311
303
|
* This function ensures that `path` is resolved absolutely, and that the URL
|
312
304
|
* control characters are correctly encoded when converting into a File URL.
|
@@ -324,7 +316,7 @@ declare module "url" {
|
|
324
316
|
* @param path The path to convert to a File URL.
|
325
317
|
* @return The file URL object.
|
326
318
|
*/
|
327
|
-
function pathToFileURL(path: string
|
319
|
+
function pathToFileURL(path: string): URL;
|
328
320
|
/**
|
329
321
|
* This utility function converts a URL object into an ordinary options object as
|
330
322
|
* expected by the `http.request()` and `https.request()` APIs.
|