node-red-contrib-tak-registration 0.11.1 → 0.11.5
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.
- package/node_modules/@types/node/LICENSE +0 -0
- package/node_modules/@types/node/README.md +4 -5
- package/node_modules/@types/node/assert/strict.d.ts +4 -4
- package/node_modules/@types/node/assert.d.ts +50 -26
- package/node_modules/@types/node/async_hooks.d.ts +13 -6
- package/node_modules/@types/node/buffer.d.ts +46 -38
- package/node_modules/@types/node/child_process.d.ts +278 -138
- package/node_modules/@types/node/cluster.d.ts +107 -89
- package/node_modules/@types/node/console.d.ts +18 -15
- package/node_modules/@types/node/constants.d.ts +12 -11
- package/node_modules/@types/node/crypto.d.ts +746 -268
- package/node_modules/@types/node/dgram.d.ts +82 -46
- package/node_modules/@types/node/diagnostics_channel.d.ts +3 -3
- package/node_modules/@types/node/dns/promises.d.ts +37 -26
- package/node_modules/@types/node/dns.d.ts +204 -63
- package/node_modules/@types/node/dom-events.d.ts +67 -71
- package/node_modules/@types/node/domain.d.ts +4 -4
- package/node_modules/@types/node/events.d.ts +99 -8
- package/node_modules/@types/node/fs/promises.d.ts +122 -85
- package/node_modules/@types/node/fs.d.ts +520 -316
- package/node_modules/@types/node/globals.d.ts +346 -286
- package/node_modules/@types/node/globals.global.d.ts +0 -0
- package/node_modules/@types/node/http.d.ts +321 -189
- package/node_modules/@types/node/http2.d.ts +630 -377
- package/node_modules/@types/node/https.d.ts +221 -112
- package/node_modules/@types/node/index.d.ts +0 -45
- package/node_modules/@types/node/inspector.d.ts +0 -1
- package/node_modules/@types/node/module.d.ts +75 -31
- package/node_modules/@types/node/net.d.ts +149 -93
- package/node_modules/@types/node/os.d.ts +10 -9
- package/node_modules/@types/node/package.json +88 -90
- package/node_modules/@types/node/path.d.ts +13 -13
- package/node_modules/@types/node/perf_hooks.d.ts +19 -18
- package/node_modules/@types/node/process.d.ts +170 -126
- package/node_modules/@types/node/punycode.d.ts +4 -4
- package/node_modules/@types/node/querystring.d.ts +14 -4
- package/node_modules/@types/node/readline/promises.d.ts +12 -7
- package/node_modules/@types/node/readline.d.ts +69 -56
- package/node_modules/@types/node/repl.d.ts +67 -61
- package/node_modules/@types/node/stream/consumers.d.ts +10 -10
- package/node_modules/@types/node/stream/promises.d.ts +56 -15
- package/node_modules/@types/node/stream/web.d.ts +40 -20
- package/node_modules/@types/node/stream.d.ts +365 -232
- package/node_modules/@types/node/string_decoder.d.ts +8 -8
- package/node_modules/@types/node/test.d.ts +133 -212
- package/node_modules/@types/node/timers/promises.d.ts +4 -4
- package/node_modules/@types/node/timers.d.ts +26 -11
- package/node_modules/@types/node/tls.d.ts +152 -72
- package/node_modules/@types/node/trace_events.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/assert.d.ts +50 -26
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +13 -6
- package/node_modules/@types/node/ts4.8/buffer.d.ts +47 -39
- package/node_modules/@types/node/ts4.8/child_process.d.ts +278 -138
- package/node_modules/@types/node/ts4.8/cluster.d.ts +107 -89
- package/node_modules/@types/node/ts4.8/console.d.ts +18 -15
- package/node_modules/@types/node/ts4.8/constants.d.ts +12 -11
- package/node_modules/@types/node/ts4.8/crypto.d.ts +746 -268
- package/node_modules/@types/node/ts4.8/dgram.d.ts +82 -46
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +37 -26
- package/node_modules/@types/node/ts4.8/dns.d.ts +204 -63
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +67 -71
- package/node_modules/@types/node/ts4.8/domain.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/events.d.ts +99 -8
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +122 -85
- package/node_modules/@types/node/ts4.8/fs.d.ts +520 -316
- package/node_modules/@types/node/ts4.8/globals.d.ts +346 -286
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -0
- package/node_modules/@types/node/ts4.8/http.d.ts +321 -189
- package/node_modules/@types/node/ts4.8/http2.d.ts +630 -377
- package/node_modules/@types/node/ts4.8/https.d.ts +221 -112
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -0
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/module.d.ts +75 -31
- package/node_modules/@types/node/ts4.8/net.d.ts +149 -93
- package/node_modules/@types/node/ts4.8/os.d.ts +10 -9
- package/node_modules/@types/node/ts4.8/path.d.ts +13 -13
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +19 -18
- package/node_modules/@types/node/ts4.8/process.d.ts +170 -126
- package/node_modules/@types/node/ts4.8/punycode.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/querystring.d.ts +14 -4
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +12 -7
- package/node_modules/@types/node/ts4.8/readline.d.ts +69 -56
- package/node_modules/@types/node/ts4.8/repl.d.ts +67 -61
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +10 -10
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +56 -15
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +40 -20
- package/node_modules/@types/node/ts4.8/stream.d.ts +494 -223
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +8 -8
- package/node_modules/@types/node/ts4.8/test.d.ts +135 -214
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/timers.d.ts +26 -11
- package/node_modules/@types/node/ts4.8/tls.d.ts +152 -72
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/tty.d.ts +10 -10
- package/node_modules/@types/node/ts4.8/url.d.ts +26 -14
- package/node_modules/@types/node/ts4.8/util.d.ts +187 -120
- package/node_modules/@types/node/ts4.8/v8.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/vm.d.ts +58 -50
- package/node_modules/@types/node/ts4.8/wasi.d.ts +10 -4
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +83 -86
- package/node_modules/@types/node/ts4.8/zlib.d.ts +9 -9
- package/node_modules/@types/node/tty.d.ts +10 -10
- package/node_modules/@types/node/url.d.ts +26 -14
- package/node_modules/@types/node/util.d.ts +187 -120
- package/node_modules/@types/node/v8.d.ts +4 -4
- package/node_modules/@types/node/vm.d.ts +58 -50
- package/node_modules/@types/node/wasi.d.ts +10 -4
- package/node_modules/@types/node/worker_threads.d.ts +83 -86
- package/node_modules/@types/node/zlib.d.ts +9 -9
- package/node_modules/axios/CHANGELOG.md +225 -0
- package/node_modules/axios/README.md +273 -9
- package/node_modules/axios/dist/axios.js +249 -178
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +213 -193
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +213 -193
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +297 -213
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +20 -11
- package/node_modules/axios/index.d.ts +21 -12
- package/node_modules/axios/lib/adapters/adapters.js +33 -15
- package/node_modules/axios/lib/adapters/http.js +25 -12
- package/node_modules/axios/lib/adapters/xhr.js +17 -10
- package/node_modules/axios/lib/core/mergeConfig.js +1 -0
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +39 -49
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +2 -2
- package/node_modules/axios/lib/platform/browser/index.js +0 -51
- package/node_modules/axios/lib/platform/common/utils.js +47 -0
- package/node_modules/axios/lib/platform/index.js +5 -1
- package/node_modules/axios/package.json +2 -1
- package/node_modules/call-bind/.eslintrc +0 -1
- package/node_modules/call-bind/.nycrc +0 -4
- package/node_modules/call-bind/CHANGELOG.md +35 -0
- package/node_modules/call-bind/README.md +63 -1
- package/node_modules/call-bind/index.js +10 -13
- package/node_modules/call-bind/package.json +33 -23
- package/node_modules/call-bind/test/callBound.js +0 -1
- package/node_modules/call-bind/test/index.js +18 -4
- package/node_modules/{function-bind → deep-equal}/.editorconfig +1 -1
- package/node_modules/deep-equal/.eslintrc +6 -0
- package/node_modules/deep-equal/.nycrc +17 -0
- package/node_modules/deep-equal/CHANGELOG.md +204 -4
- package/node_modules/deep-equal/assert.js +3 -0
- package/node_modules/deep-equal/package.json +39 -17
- package/node_modules/deep-equal/readme.markdown +28 -12
- package/node_modules/deep-equal/test/_tape.js +24 -3
- package/node_modules/deep-equal/test/cmp.js +1047 -48
- package/node_modules/define-data-property/CHANGELOG.md +10 -0
- package/node_modules/define-data-property/index.d.ts.map +1 -1
- package/node_modules/define-data-property/index.js +8 -0
- package/node_modules/define-data-property/package.json +11 -9
- package/node_modules/define-data-property/test/index.js +6 -11
- package/node_modules/define-data-property/tsconfig.json +1 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +11 -0
- package/node_modules/fast-xml-parser/package.json +5 -5
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +1 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +4 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +6 -3
- package/node_modules/follow-redirects/index.js +16 -4
- package/node_modules/follow-redirects/package.json +2 -3
- package/node_modules/function-bind/.eslintrc +11 -5
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/README.md +25 -27
- package/node_modules/function-bind/implementation.js +44 -12
- package/node_modules/function-bind/package.json +38 -14
- package/node_modules/get-intrinsic/CHANGELOG.md +8 -0
- package/node_modules/get-intrinsic/index.js +1 -1
- package/node_modules/get-intrinsic/package.json +11 -11
- package/node_modules/has-property-descriptors/CHANGELOG.md +11 -0
- package/node_modules/has-property-descriptors/package.json +13 -6
- package/node_modules/hasown/.eslintrc +5 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +20 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.d.ts.map +1 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +49 -0
- package/node_modules/set-function-length/.eslintrc +27 -0
- package/node_modules/set-function-length/.github/FUNDING.yml +12 -0
- package/node_modules/set-function-length/.nycrc +13 -0
- package/node_modules/set-function-length/CHANGELOG.md +41 -0
- package/node_modules/set-function-length/LICENSE +21 -0
- package/node_modules/set-function-length/README.md +56 -0
- package/node_modules/set-function-length/env.js +19 -0
- package/node_modules/set-function-length/index.js +41 -0
- package/node_modules/set-function-length/package.json +84 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +97 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/node_modules/undici-types/errors.d.ts +128 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +9 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +63 -0
- package/node_modules/undici-types/interceptors.d.ts +5 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +71 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +28 -0
- package/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/node_modules/undici-types/readable.d.ts +61 -0
- package/node_modules/undici-types/webidl.d.ts +220 -0
- package/node_modules/undici-types/websocket.d.ts +131 -0
- package/package.json +3 -3
- package/tak-ingest.js +42 -23
- package/tak-registration.html +4 -4
- package/node_modules/define-data-property/tsinit +0 -109
- package/node_modules/function-bind/.jscs.json +0 -176
- package/node_modules/function-bind/.npmignore +0 -22
- package/node_modules/function-bind/.travis.yml +0 -168
- package/node_modules/has/LICENSE-MIT +0 -22
- package/node_modules/has/README.md +0 -18
- package/node_modules/has/package.json +0 -48
- package/node_modules/has/src/index.js +0 -5
- package/node_modules/has/test/index.js +0 -10
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* const decoder = new StringDecoder('utf8');
|
|
15
15
|
*
|
|
16
16
|
* const cent = Buffer.from([0xC2, 0xA2]);
|
|
17
|
-
* console.log(decoder.write(cent));
|
|
17
|
+
* console.log(decoder.write(cent)); // Prints: ¢
|
|
18
18
|
*
|
|
19
19
|
* const euro = Buffer.from([0xE2, 0x82, 0xAC]);
|
|
20
|
-
* console.log(decoder.write(euro));
|
|
20
|
+
* console.log(decoder.write(euro)); // Prints: €
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
23
|
* When a `Buffer` instance is written to the `StringDecoder` instance, an
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
*
|
|
35
35
|
* decoder.write(Buffer.from([0xE2]));
|
|
36
36
|
* decoder.write(Buffer.from([0x82]));
|
|
37
|
-
* console.log(decoder.end(Buffer.from([0xAC])));
|
|
37
|
+
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
|
|
38
38
|
* ```
|
|
39
39
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js)
|
|
40
40
|
*/
|
|
41
|
-
declare module
|
|
41
|
+
declare module "string_decoder" {
|
|
42
42
|
class StringDecoder {
|
|
43
43
|
constructor(encoding?: BufferEncoding);
|
|
44
44
|
/**
|
|
@@ -46,7 +46,7 @@ declare module 'string_decoder' {
|
|
|
46
46
|
* the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
|
|
47
47
|
* returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`.
|
|
48
48
|
* @since v0.1.99
|
|
49
|
-
* @param buffer
|
|
49
|
+
* @param buffer The bytes to decode.
|
|
50
50
|
*/
|
|
51
51
|
write(buffer: Buffer): string;
|
|
52
52
|
/**
|
|
@@ -57,11 +57,11 @@ declare module 'string_decoder' {
|
|
|
57
57
|
* If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input.
|
|
58
58
|
* After `end()` is called, the `stringDecoder` object can be reused for new input.
|
|
59
59
|
* @since v0.9.3
|
|
60
|
-
* @param buffer
|
|
60
|
+
* @param buffer The bytes to decode.
|
|
61
61
|
*/
|
|
62
62
|
end(buffer?: Buffer): string;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
declare module
|
|
66
|
-
export * from
|
|
65
|
+
declare module "node:string_decoder" {
|
|
66
|
+
export * from "string_decoder";
|
|
67
67
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* 1. A synchronous function that is considered failing if it throws an exception,
|
|
20
20
|
* and is considered passing otherwise.
|
|
21
|
-
* 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise`
|
|
21
|
+
* 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` fulfills.
|
|
22
22
|
* 3. A function that receives a callback function. If the callback receives any
|
|
23
23
|
* truthy value as its first argument, the test is considered failing. If a
|
|
24
24
|
* falsy value is passed as the first argument to the callback, the test is
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
*
|
|
41
41
|
* test('asynchronous passing test', async (t) => {
|
|
42
42
|
* // This test passes because the Promise returned by the async
|
|
43
|
-
* // function is not rejected.
|
|
43
|
+
* // function is settled and not rejected.
|
|
44
44
|
* assert.strictEqual(1, 1);
|
|
45
45
|
* });
|
|
46
46
|
*
|
|
@@ -76,15 +76,17 @@
|
|
|
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.4.0/lib/test.js)
|
|
80
80
|
*/
|
|
81
|
-
declare module
|
|
82
|
-
import { Readable } from
|
|
83
|
-
import { AsyncResource } from
|
|
81
|
+
declare module "node:test" {
|
|
82
|
+
import { Readable } from "node:stream";
|
|
83
|
+
import { AsyncResource } from "node:async_hooks";
|
|
84
84
|
/**
|
|
85
85
|
* ```js
|
|
86
86
|
* import { tap } from 'node:test/reporters';
|
|
87
|
+
* import { run } from 'node:test';
|
|
87
88
|
* import process from 'node:process';
|
|
89
|
+
* import path from 'node:path';
|
|
88
90
|
*
|
|
89
91
|
* run({ files: [path.resolve('./tests/test.js')] })
|
|
90
92
|
* .compose(tap)
|
|
@@ -102,8 +104,8 @@ declare module 'node:test' {
|
|
|
102
104
|
* actions related to the current test. Examples include skipping the test, adding
|
|
103
105
|
* additional diagnostic information, or creating subtests.
|
|
104
106
|
*
|
|
105
|
-
* `test()` returns a `Promise` that
|
|
106
|
-
* if `test()` is called within a `describe()` block, it
|
|
107
|
+
* `test()` returns a `Promise` that fulfills once the test completes.
|
|
108
|
+
* if `test()` is called within a `describe()` block, it fulfills immediately.
|
|
107
109
|
* The return value can usually be discarded for top level tests.
|
|
108
110
|
* However, the return value from subtests should be used to prevent the parent
|
|
109
111
|
* test from finishing first and cancelling the subtest
|
|
@@ -130,27 +132,14 @@ declare module 'node:test' {
|
|
|
130
132
|
* @param options Configuration options for the test. The following properties are supported:
|
|
131
133
|
* @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 callback function is passed as the
|
|
132
134
|
* second argument.
|
|
133
|
-
* @return
|
|
135
|
+
* @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within {@link describe}.
|
|
134
136
|
*/
|
|
135
137
|
function test(name?: string, fn?: TestFn): Promise<void>;
|
|
136
138
|
function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
137
139
|
function test(options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
138
140
|
function test(fn?: TestFn): Promise<void>;
|
|
139
141
|
namespace test {
|
|
140
|
-
export {
|
|
141
|
-
after,
|
|
142
|
-
afterEach,
|
|
143
|
-
before,
|
|
144
|
-
beforeEach,
|
|
145
|
-
describe,
|
|
146
|
-
it,
|
|
147
|
-
run,
|
|
148
|
-
mock,
|
|
149
|
-
test,
|
|
150
|
-
skip,
|
|
151
|
-
todo,
|
|
152
|
-
only
|
|
153
|
-
};
|
|
142
|
+
export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
|
|
154
143
|
}
|
|
155
144
|
/**
|
|
156
145
|
* The `describe()` function imported from the `node:test` module. Each
|
|
@@ -305,10 +294,14 @@ declare module 'node:test' {
|
|
|
305
294
|
* For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run.
|
|
306
295
|
*/
|
|
307
296
|
testNamePatterns?: string | RegExp | string[] | RegExp[];
|
|
297
|
+
/**
|
|
298
|
+
* If truthy, the test context will only run tests that have the `only` option set
|
|
299
|
+
*/
|
|
300
|
+
only?: boolean;
|
|
308
301
|
/**
|
|
309
302
|
* A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
|
|
310
303
|
*/
|
|
311
|
-
setup?: (root:
|
|
304
|
+
setup?: (root: Test) => void | Promise<void>;
|
|
312
305
|
/**
|
|
313
306
|
* Whether to run in watch mode or not.
|
|
314
307
|
* @default false
|
|
@@ -335,53 +328,53 @@ declare module 'node:test' {
|
|
|
335
328
|
* @since v18.9.0, v16.19.0
|
|
336
329
|
*/
|
|
337
330
|
class TestsStream extends Readable implements NodeJS.ReadableStream {
|
|
338
|
-
addListener(event:
|
|
339
|
-
addListener(event:
|
|
340
|
-
addListener(event:
|
|
341
|
-
addListener(event:
|
|
342
|
-
addListener(event:
|
|
343
|
-
addListener(event:
|
|
344
|
-
addListener(event:
|
|
331
|
+
addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
|
332
|
+
addListener(event: "test:fail", listener: (data: TestFail) => void): this;
|
|
333
|
+
addListener(event: "test:pass", listener: (data: TestPass) => void): this;
|
|
334
|
+
addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
|
|
335
|
+
addListener(event: "test:start", listener: (data: TestStart) => void): this;
|
|
336
|
+
addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
|
337
|
+
addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
|
345
338
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
346
|
-
emit(event:
|
|
347
|
-
emit(event:
|
|
348
|
-
emit(event:
|
|
349
|
-
emit(event:
|
|
350
|
-
emit(event:
|
|
351
|
-
emit(event:
|
|
352
|
-
emit(event:
|
|
339
|
+
emit(event: "test:diagnostic", data: DiagnosticData): boolean;
|
|
340
|
+
emit(event: "test:fail", data: TestFail): boolean;
|
|
341
|
+
emit(event: "test:pass", data: TestPass): boolean;
|
|
342
|
+
emit(event: "test:plan", data: TestPlan): boolean;
|
|
343
|
+
emit(event: "test:start", data: TestStart): boolean;
|
|
344
|
+
emit(event: "test:stderr", data: TestStderr): boolean;
|
|
345
|
+
emit(event: "test:stdout", data: TestStdout): boolean;
|
|
353
346
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
354
|
-
on(event:
|
|
355
|
-
on(event:
|
|
356
|
-
on(event:
|
|
357
|
-
on(event:
|
|
358
|
-
on(event:
|
|
359
|
-
on(event:
|
|
360
|
-
on(event:
|
|
347
|
+
on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
|
348
|
+
on(event: "test:fail", listener: (data: TestFail) => void): this;
|
|
349
|
+
on(event: "test:pass", listener: (data: TestPass) => void): this;
|
|
350
|
+
on(event: "test:plan", listener: (data: TestPlan) => void): this;
|
|
351
|
+
on(event: "test:start", listener: (data: TestStart) => void): this;
|
|
352
|
+
on(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
|
353
|
+
on(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
|
361
354
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
362
|
-
once(event:
|
|
363
|
-
once(event:
|
|
364
|
-
once(event:
|
|
365
|
-
once(event:
|
|
366
|
-
once(event:
|
|
367
|
-
once(event:
|
|
368
|
-
once(event:
|
|
355
|
+
once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
|
356
|
+
once(event: "test:fail", listener: (data: TestFail) => void): this;
|
|
357
|
+
once(event: "test:pass", listener: (data: TestPass) => void): this;
|
|
358
|
+
once(event: "test:plan", listener: (data: TestPlan) => void): this;
|
|
359
|
+
once(event: "test:start", listener: (data: TestStart) => void): this;
|
|
360
|
+
once(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
|
361
|
+
once(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
|
369
362
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
370
|
-
prependListener(event:
|
|
371
|
-
prependListener(event:
|
|
372
|
-
prependListener(event:
|
|
373
|
-
prependListener(event:
|
|
374
|
-
prependListener(event:
|
|
375
|
-
prependListener(event:
|
|
376
|
-
prependListener(event:
|
|
363
|
+
prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
|
364
|
+
prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
|
|
365
|
+
prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
|
|
366
|
+
prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
|
|
367
|
+
prependListener(event: "test:start", listener: (data: TestStart) => void): this;
|
|
368
|
+
prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
|
369
|
+
prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
|
377
370
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
378
|
-
prependOnceListener(event:
|
|
379
|
-
prependOnceListener(event:
|
|
380
|
-
prependOnceListener(event:
|
|
381
|
-
prependOnceListener(event:
|
|
382
|
-
prependOnceListener(event:
|
|
383
|
-
prependOnceListener(event:
|
|
384
|
-
prependOnceListener(event:
|
|
371
|
+
prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
|
|
372
|
+
prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
|
|
373
|
+
prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
|
|
374
|
+
prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
|
|
375
|
+
prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this;
|
|
376
|
+
prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
|
|
377
|
+
prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
|
|
385
378
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
386
379
|
}
|
|
387
380
|
/**
|
|
@@ -739,7 +732,11 @@ declare module 'node:test' {
|
|
|
739
732
|
* behavior of the mocked function.
|
|
740
733
|
*/
|
|
741
734
|
fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
|
|
742
|
-
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
|
|
735
|
+
fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
|
|
736
|
+
original?: F,
|
|
737
|
+
implementation?: Implementation,
|
|
738
|
+
options?: MockFunctionOptions,
|
|
739
|
+
): Mock<F | Implementation>;
|
|
743
740
|
/**
|
|
744
741
|
* This function is used to create a mock on an existing object method. The
|
|
745
742
|
* following example demonstrates how a mock is created on an existing object
|
|
@@ -783,8 +780,7 @@ declare module 'node:test' {
|
|
|
783
780
|
object: MockedObject,
|
|
784
781
|
methodName: MethodName,
|
|
785
782
|
options?: MockFunctionOptions,
|
|
786
|
-
): MockedObject[MethodName] extends Function
|
|
787
|
-
? Mock<MockedObject[MethodName]>
|
|
783
|
+
): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
|
|
788
784
|
: never;
|
|
789
785
|
method<
|
|
790
786
|
MockedObject extends object,
|
|
@@ -795,8 +791,7 @@ declare module 'node:test' {
|
|
|
795
791
|
methodName: MethodName,
|
|
796
792
|
implementation: Implementation,
|
|
797
793
|
options?: MockFunctionOptions,
|
|
798
|
-
): MockedObject[MethodName] extends Function
|
|
799
|
-
? Mock<MockedObject[MethodName] | Implementation>
|
|
794
|
+
): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
|
|
800
795
|
: never;
|
|
801
796
|
method<MockedObject extends object>(
|
|
802
797
|
object: MockedObject,
|
|
@@ -877,16 +872,12 @@ declare module 'node:test' {
|
|
|
877
872
|
const mock: MockTracker;
|
|
878
873
|
interface MockFunctionCall<
|
|
879
874
|
F extends Function,
|
|
880
|
-
ReturnType = F extends (...args: any) => infer T
|
|
881
|
-
? T
|
|
882
|
-
:
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
? Y
|
|
887
|
-
: F extends abstract new (...args: infer Y) => any
|
|
888
|
-
? Y
|
|
889
|
-
: unknown[],
|
|
875
|
+
ReturnType = F extends (...args: any) => infer T ? T
|
|
876
|
+
: F extends abstract new(...args: any) => infer T ? T
|
|
877
|
+
: unknown,
|
|
878
|
+
Args = F extends (...args: infer Y) => any ? Y
|
|
879
|
+
: F extends abstract new(...args: infer Y) => any ? Y
|
|
880
|
+
: unknown[],
|
|
890
881
|
> {
|
|
891
882
|
/**
|
|
892
883
|
* An array of the arguments passed to the mock function.
|
|
@@ -910,7 +901,7 @@ declare module 'node:test' {
|
|
|
910
901
|
* If the mocked function is a constructor, this field contains the class being constructed.
|
|
911
902
|
* Otherwise this will be `undefined`.
|
|
912
903
|
*/
|
|
913
|
-
target: F extends abstract new
|
|
904
|
+
target: F extends abstract new(...args: any) => any ? F : undefined;
|
|
914
905
|
/**
|
|
915
906
|
* The mocked function's `this` value.
|
|
916
907
|
*/
|
|
@@ -1016,7 +1007,7 @@ declare module 'node:test' {
|
|
|
1016
1007
|
*/
|
|
1017
1008
|
restore(): void;
|
|
1018
1009
|
}
|
|
1019
|
-
type Timer =
|
|
1010
|
+
type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout";
|
|
1020
1011
|
/**
|
|
1021
1012
|
* Mocking timers is a technique commonly used in software testing to simulate and
|
|
1022
1013
|
* control the behavior of timers, such as `setInterval` and `setTimeout`,
|
|
@@ -1041,11 +1032,6 @@ declare module 'node:test' {
|
|
|
1041
1032
|
* mock.timers.enable(['setInterval']);
|
|
1042
1033
|
* ```
|
|
1043
1034
|
*
|
|
1044
|
-
* ```js
|
|
1045
|
-
* const { mock } = require('node:test');
|
|
1046
|
-
* mock.timers.enable(['setInterval']);
|
|
1047
|
-
* ```
|
|
1048
|
-
*
|
|
1049
1035
|
* The above example enables mocking for the `setInterval` timer and
|
|
1050
1036
|
* implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked.
|
|
1051
1037
|
*
|
|
@@ -1069,11 +1055,6 @@ declare module 'node:test' {
|
|
|
1069
1055
|
* import { mock } from 'node:test';
|
|
1070
1056
|
* mock.timers.reset();
|
|
1071
1057
|
* ```
|
|
1072
|
-
*
|
|
1073
|
-
* ```js
|
|
1074
|
-
* const { mock } = require('node:test');
|
|
1075
|
-
* mock.timers.reset();
|
|
1076
|
-
* ```
|
|
1077
1058
|
* @since v20.4.0
|
|
1078
1059
|
*/
|
|
1079
1060
|
reset(): void;
|
|
@@ -1108,24 +1089,6 @@ declare module 'node:test' {
|
|
|
1108
1089
|
* });
|
|
1109
1090
|
* ```
|
|
1110
1091
|
*
|
|
1111
|
-
* ```js
|
|
1112
|
-
* const assert = require('node:assert');
|
|
1113
|
-
* const { test } = require('node:test');
|
|
1114
|
-
*
|
|
1115
|
-
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
|
|
1116
|
-
* const fn = context.mock.fn();
|
|
1117
|
-
* context.mock.timers.enable(['setTimeout']);
|
|
1118
|
-
*
|
|
1119
|
-
* setTimeout(fn, 9999);
|
|
1120
|
-
* assert.strictEqual(fn.mock.callCount(), 0);
|
|
1121
|
-
*
|
|
1122
|
-
* // Advance in time
|
|
1123
|
-
* context.mock.timers.tick(9999);
|
|
1124
|
-
*
|
|
1125
|
-
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1126
|
-
* });
|
|
1127
|
-
* ```
|
|
1128
|
-
*
|
|
1129
1092
|
* Alternativelly, the `.tick` function can be called many times
|
|
1130
1093
|
*
|
|
1131
1094
|
* ```js
|
|
@@ -1146,25 +1109,6 @@ declare module 'node:test' {
|
|
|
1146
1109
|
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1147
1110
|
* });
|
|
1148
1111
|
* ```
|
|
1149
|
-
*
|
|
1150
|
-
* ```js
|
|
1151
|
-
* const assert = require('node:assert');
|
|
1152
|
-
* const { test } = require('node:test');
|
|
1153
|
-
*
|
|
1154
|
-
* test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
|
|
1155
|
-
* const fn = context.mock.fn();
|
|
1156
|
-
* context.mock.timers.enable(['setTimeout']);
|
|
1157
|
-
* const nineSecs = 9000;
|
|
1158
|
-
* setTimeout(fn, nineSecs);
|
|
1159
|
-
*
|
|
1160
|
-
* const twoSeconds = 3000;
|
|
1161
|
-
* context.mock.timers.tick(twoSeconds);
|
|
1162
|
-
* context.mock.timers.tick(twoSeconds);
|
|
1163
|
-
* context.mock.timers.tick(twoSeconds);
|
|
1164
|
-
*
|
|
1165
|
-
* assert.strictEqual(fn.mock.callCount(), 1);
|
|
1166
|
-
* });
|
|
1167
|
-
* ```
|
|
1168
1112
|
* @since v20.4.0
|
|
1169
1113
|
*/
|
|
1170
1114
|
tick(milliseconds: number): void;
|
|
@@ -1196,28 +1140,6 @@ declare module 'node:test' {
|
|
|
1196
1140
|
* });
|
|
1197
1141
|
* ```
|
|
1198
1142
|
*
|
|
1199
|
-
* ```js
|
|
1200
|
-
* const assert = require('node:assert');
|
|
1201
|
-
* const { test } = require('node:test');
|
|
1202
|
-
*
|
|
1203
|
-
* test('runAll functions following the given order', (context) => {
|
|
1204
|
-
* context.mock.timers.enable(['setTimeout']);
|
|
1205
|
-
* const results = [];
|
|
1206
|
-
* setTimeout(() => results.push(1), 9999);
|
|
1207
|
-
*
|
|
1208
|
-
* // Notice that if both timers have the same timeout,
|
|
1209
|
-
* // the order of execution is guaranteed
|
|
1210
|
-
* setTimeout(() => results.push(3), 8888);
|
|
1211
|
-
* setTimeout(() => results.push(2), 8888);
|
|
1212
|
-
*
|
|
1213
|
-
* assert.deepStrictEqual(results, []);
|
|
1214
|
-
*
|
|
1215
|
-
* context.mock.timers.runAll();
|
|
1216
|
-
*
|
|
1217
|
-
* assert.deepStrictEqual(results, [3, 2, 1]);
|
|
1218
|
-
* });
|
|
1219
|
-
* ```
|
|
1220
|
-
*
|
|
1221
1143
|
* **Note:** The `runAll()` function is specifically designed for
|
|
1222
1144
|
* triggering timers in the context of timer mocking.
|
|
1223
1145
|
* It does not have any effect on real-time system
|
|
@@ -1230,10 +1152,41 @@ declare module 'node:test' {
|
|
|
1230
1152
|
*/
|
|
1231
1153
|
[Symbol.dispose](): void;
|
|
1232
1154
|
}
|
|
1233
|
-
export {
|
|
1155
|
+
export {
|
|
1156
|
+
after,
|
|
1157
|
+
afterEach,
|
|
1158
|
+
before,
|
|
1159
|
+
beforeEach,
|
|
1160
|
+
describe,
|
|
1161
|
+
it,
|
|
1162
|
+
Mock,
|
|
1163
|
+
mock,
|
|
1164
|
+
only,
|
|
1165
|
+
run,
|
|
1166
|
+
skip,
|
|
1167
|
+
test,
|
|
1168
|
+
test as default,
|
|
1169
|
+
todo,
|
|
1170
|
+
};
|
|
1234
1171
|
}
|
|
1235
1172
|
|
|
1236
|
-
interface
|
|
1173
|
+
interface TestLocationInfo {
|
|
1174
|
+
/**
|
|
1175
|
+
* The column number where the test is defined, or
|
|
1176
|
+
* `undefined` if the test was run through the REPL.
|
|
1177
|
+
*/
|
|
1178
|
+
column?: number;
|
|
1179
|
+
/**
|
|
1180
|
+
* The path of the test file, `undefined` if test is not ran through a file.
|
|
1181
|
+
*/
|
|
1182
|
+
file?: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* The line number where the test is defined, or
|
|
1185
|
+
* `undefined` if the test was run through the REPL.
|
|
1186
|
+
*/
|
|
1187
|
+
line?: number;
|
|
1188
|
+
}
|
|
1189
|
+
interface DiagnosticData extends TestLocationInfo {
|
|
1237
1190
|
/**
|
|
1238
1191
|
* The diagnostic message.
|
|
1239
1192
|
*/
|
|
@@ -1242,12 +1195,8 @@ interface DiagnosticData {
|
|
|
1242
1195
|
* The nesting level of the test.
|
|
1243
1196
|
*/
|
|
1244
1197
|
nesting: number;
|
|
1245
|
-
/**
|
|
1246
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1247
|
-
*/
|
|
1248
|
-
file?: string;
|
|
1249
1198
|
}
|
|
1250
|
-
interface TestFail {
|
|
1199
|
+
interface TestFail extends TestLocationInfo {
|
|
1251
1200
|
/**
|
|
1252
1201
|
* Additional execution metadata.
|
|
1253
1202
|
*/
|
|
@@ -1264,7 +1213,7 @@ interface TestFail {
|
|
|
1264
1213
|
* The type of the test, used to denote whether this is a suite.
|
|
1265
1214
|
* @since 20.0.0, 19.9.0, 18.17.0
|
|
1266
1215
|
*/
|
|
1267
|
-
type?:
|
|
1216
|
+
type?: "suite";
|
|
1268
1217
|
};
|
|
1269
1218
|
/**
|
|
1270
1219
|
* The test name.
|
|
@@ -1286,12 +1235,8 @@ interface TestFail {
|
|
|
1286
1235
|
* Present if `context.skip` is called.
|
|
1287
1236
|
*/
|
|
1288
1237
|
skip?: string | boolean;
|
|
1289
|
-
/**
|
|
1290
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1291
|
-
*/
|
|
1292
|
-
file?: string;
|
|
1293
1238
|
}
|
|
1294
|
-
interface TestPass {
|
|
1239
|
+
interface TestPass extends TestLocationInfo {
|
|
1295
1240
|
/**
|
|
1296
1241
|
* Additional execution metadata.
|
|
1297
1242
|
*/
|
|
@@ -1304,7 +1249,7 @@ interface TestPass {
|
|
|
1304
1249
|
* The type of the test, used to denote whether this is a suite.
|
|
1305
1250
|
* @since 20.0.0, 19.9.0, 18.17.0
|
|
1306
1251
|
*/
|
|
1307
|
-
type?:
|
|
1252
|
+
type?: "suite";
|
|
1308
1253
|
};
|
|
1309
1254
|
/**
|
|
1310
1255
|
* The test name.
|
|
@@ -1326,12 +1271,8 @@ interface TestPass {
|
|
|
1326
1271
|
* Present if `context.skip` is called.
|
|
1327
1272
|
*/
|
|
1328
1273
|
skip?: string | boolean;
|
|
1329
|
-
/**
|
|
1330
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1331
|
-
*/
|
|
1332
|
-
file?: string;
|
|
1333
1274
|
}
|
|
1334
|
-
interface TestPlan {
|
|
1275
|
+
interface TestPlan extends TestLocationInfo {
|
|
1335
1276
|
/**
|
|
1336
1277
|
* The nesting level of the test.
|
|
1337
1278
|
*/
|
|
@@ -1340,12 +1281,8 @@ interface TestPlan {
|
|
|
1340
1281
|
* The number of subtests that have ran.
|
|
1341
1282
|
*/
|
|
1342
1283
|
count: number;
|
|
1343
|
-
/**
|
|
1344
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1345
|
-
*/
|
|
1346
|
-
file?: string;
|
|
1347
1284
|
}
|
|
1348
|
-
interface TestStart {
|
|
1285
|
+
interface TestStart extends TestLocationInfo {
|
|
1349
1286
|
/**
|
|
1350
1287
|
* The test name.
|
|
1351
1288
|
*/
|
|
@@ -1354,54 +1291,34 @@ interface TestStart {
|
|
|
1354
1291
|
* The nesting level of the test.
|
|
1355
1292
|
*/
|
|
1356
1293
|
nesting: number;
|
|
1357
|
-
/**
|
|
1358
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1359
|
-
*/
|
|
1360
|
-
file?: string;
|
|
1361
1294
|
}
|
|
1362
|
-
interface TestStderr {
|
|
1363
|
-
/**
|
|
1364
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1365
|
-
*/
|
|
1366
|
-
file?: string;
|
|
1295
|
+
interface TestStderr extends TestLocationInfo {
|
|
1367
1296
|
/**
|
|
1368
1297
|
* The message written to `stderr`
|
|
1369
1298
|
*/
|
|
1370
1299
|
message: string;
|
|
1371
1300
|
}
|
|
1372
|
-
interface TestStdout {
|
|
1373
|
-
/**
|
|
1374
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1375
|
-
*/
|
|
1376
|
-
file?: string;
|
|
1301
|
+
interface TestStdout extends TestLocationInfo {
|
|
1377
1302
|
/**
|
|
1378
1303
|
* The message written to `stdout`
|
|
1379
1304
|
*/
|
|
1380
1305
|
message: string;
|
|
1381
1306
|
}
|
|
1382
|
-
interface TestEnqueue {
|
|
1307
|
+
interface TestEnqueue extends TestLocationInfo {
|
|
1383
1308
|
/**
|
|
1384
1309
|
* The test name
|
|
1385
1310
|
*/
|
|
1386
1311
|
name: string;
|
|
1387
|
-
/**
|
|
1388
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1389
|
-
*/
|
|
1390
|
-
file?: string;
|
|
1391
1312
|
/**
|
|
1392
1313
|
* The nesting level of the test.
|
|
1393
1314
|
*/
|
|
1394
1315
|
nesting: number;
|
|
1395
1316
|
}
|
|
1396
|
-
interface TestDequeue {
|
|
1317
|
+
interface TestDequeue extends TestLocationInfo {
|
|
1397
1318
|
/**
|
|
1398
1319
|
* The test name
|
|
1399
1320
|
*/
|
|
1400
1321
|
name: string;
|
|
1401
|
-
/**
|
|
1402
|
-
* The path of the test file, undefined if test is not ran through a file.
|
|
1403
|
-
*/
|
|
1404
|
-
file?: string;
|
|
1405
1322
|
/**
|
|
1406
1323
|
* The nesting level of the test.
|
|
1407
1324
|
*/
|
|
@@ -1425,20 +1342,20 @@ interface TestDequeue {
|
|
|
1425
1342
|
* @since v19.9.0
|
|
1426
1343
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js)
|
|
1427
1344
|
*/
|
|
1428
|
-
declare module
|
|
1429
|
-
import { Transform } from
|
|
1345
|
+
declare module "node:test/reporters" {
|
|
1346
|
+
import { Transform } from "node:stream";
|
|
1430
1347
|
|
|
1431
1348
|
type TestEvent =
|
|
1432
|
-
| { type:
|
|
1433
|
-
| { type:
|
|
1434
|
-
| { type:
|
|
1435
|
-
| { type:
|
|
1436
|
-
| { type:
|
|
1437
|
-
| { type:
|
|
1438
|
-
| { type:
|
|
1439
|
-
| { type:
|
|
1440
|
-
| { type:
|
|
1441
|
-
| { type:
|
|
1349
|
+
| { type: "test:diagnostic"; data: DiagnosticData }
|
|
1350
|
+
| { type: "test:fail"; data: TestFail }
|
|
1351
|
+
| { type: "test:pass"; data: TestPass }
|
|
1352
|
+
| { type: "test:plan"; data: TestPlan }
|
|
1353
|
+
| { type: "test:start"; data: TestStart }
|
|
1354
|
+
| { type: "test:stderr"; data: TestStderr }
|
|
1355
|
+
| { type: "test:stdout"; data: TestStdout }
|
|
1356
|
+
| { type: "test:enqueue"; data: TestEnqueue }
|
|
1357
|
+
| { type: "test:dequeue"; data: TestDequeue }
|
|
1358
|
+
| { type: "test:watch:drained" };
|
|
1442
1359
|
type TestEventGenerator = AsyncGenerator<TestEvent, void>;
|
|
1443
1360
|
|
|
1444
1361
|
/**
|
|
@@ -1446,7 +1363,7 @@ declare module 'node:test/reporters' {
|
|
|
1446
1363
|
* where each passing test is represented by a `.`,
|
|
1447
1364
|
* and each failing test is represented by a `X`.
|
|
1448
1365
|
*/
|
|
1449
|
-
function dot(source: TestEventGenerator): AsyncGenerator<
|
|
1366
|
+
function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
|
|
1450
1367
|
/**
|
|
1451
1368
|
* The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
|
|
1452
1369
|
*/
|
|
@@ -1457,5 +1374,9 @@ declare module 'node:test/reporters' {
|
|
|
1457
1374
|
class Spec extends Transform {
|
|
1458
1375
|
constructor();
|
|
1459
1376
|
}
|
|
1460
|
-
|
|
1377
|
+
/**
|
|
1378
|
+
* The `junit` reporter outputs test results in a jUnit XML format
|
|
1379
|
+
*/
|
|
1380
|
+
function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
|
|
1381
|
+
export { dot, junit, Spec as spec, tap, TestEvent };
|
|
1461
1382
|
}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* ```
|
|
12
12
|
* @since v15.0.0
|
|
13
13
|
*/
|
|
14
|
-
declare module
|
|
15
|
-
import { TimerOptions } from
|
|
14
|
+
declare module "timers/promises" {
|
|
15
|
+
import { TimerOptions } from "node:timers";
|
|
16
16
|
/**
|
|
17
17
|
* ```js
|
|
18
18
|
* import {
|
|
@@ -88,6 +88,6 @@ declare module 'timers/promises' {
|
|
|
88
88
|
}
|
|
89
89
|
const scheduler: Scheduler;
|
|
90
90
|
}
|
|
91
|
-
declare module
|
|
92
|
-
export * from
|
|
91
|
+
declare module "node:timers/promises" {
|
|
92
|
+
export * from "timers/promises";
|
|
93
93
|
}
|