@psnext/slingcli 3.3.20260911-1 → 3.3.20260914-1
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/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-VDBOM5UG.js → chunk-BRL3MDQL.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js +79 -32
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +25 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js +23 -8
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +13 -56
- package/node_modules/@types/node/assert.d.ts +189 -190
- package/node_modules/@types/node/async_hooks.d.ts +151 -43
- package/node_modules/@types/node/buffer.buffer.d.ts +12 -13
- package/node_modules/@types/node/buffer.d.ts +103 -237
- package/node_modules/@types/node/child_process.d.ts +39 -154
- package/node_modules/@types/node/cluster.d.ts +238 -384
- package/node_modules/@types/node/console.d.ts +45 -404
- package/node_modules/@types/node/constants.d.ts +3 -10
- package/node_modules/@types/node/crypto.d.ts +1000 -1593
- package/node_modules/@types/node/dgram.d.ts +133 -81
- package/node_modules/@types/node/diagnostics_channel.d.ts +277 -59
- package/node_modules/@types/node/dns/promises.d.ts +9 -15
- package/node_modules/@types/node/dns.d.ts +136 -183
- package/node_modules/@types/node/domain.d.ts +12 -32
- package/node_modules/@types/node/events.d.ts +872 -840
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +256 -85
- package/node_modules/@types/node/fs.d.ts +865 -525
- package/node_modules/@types/node/globals.d.ts +12 -34
- package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
- package/node_modules/@types/node/http.d.ts +433 -312
- package/node_modules/@types/node/http2.d.ts +545 -891
- package/node_modules/@types/node/https.d.ts +64 -243
- package/node_modules/@types/node/index.d.ts +25 -7
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +70 -58
- package/node_modules/@types/node/inspector.generated.d.ts +764 -410
- package/node_modules/@types/node/module.d.ts +54 -219
- package/node_modules/@types/node/net.d.ts +208 -222
- package/node_modules/@types/node/os.d.ts +41 -49
- package/node_modules/@types/node/package.json +13 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +119 -141
- package/node_modules/@types/node/perf_hooks.d.ts +339 -690
- package/node_modules/@types/node/process.d.ts +389 -205
- package/node_modules/@types/node/punycode.d.ts +3 -31
- package/node_modules/@types/node/querystring.d.ts +3 -16
- package/node_modules/@types/node/quic.d.ts +2153 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -6
- package/node_modules/@types/node/readline.d.ts +66 -152
- package/node_modules/@types/node/repl.d.ts +101 -109
- package/node_modules/@types/node/sea.d.ts +1 -116
- package/node_modules/@types/node/sqlite.d.ts +486 -68
- package/node_modules/@types/node/stream/consumers.d.ts +91 -15
- package/node_modules/@types/node/stream/iter.d.ts +452 -0
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +197 -454
- package/node_modules/@types/node/stream.d.ts +603 -491
- package/node_modules/@types/node/string_decoder.d.ts +3 -43
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +513 -292
- package/node_modules/@types/node/timers/promises.d.ts +3 -18
- package/node_modules/@types/node/timers.d.ts +3 -141
- package/node_modules/@types/node/tls.d.ts +166 -257
- package/node_modules/@types/node/trace_events.d.ts +3 -97
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -8
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +26 -6
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@types/node/tty.d.ts +61 -43
- package/node_modules/@types/node/url.d.ts +156 -584
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +170 -1099
- package/node_modules/@types/node/v8.d.ts +175 -36
- package/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@types/node/vm.d.ts +292 -209
- package/node_modules/@types/node/wasi.d.ts +24 -74
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +97 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +257 -407
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +24 -165
- package/node_modules/undici-types/agent.d.ts +12 -13
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +13 -12
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +63 -37
- package/node_modules/undici-types/connector.d.ts +5 -2
- package/node_modules/undici-types/cookies.d.ts +3 -1
- package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/node_modules/undici-types/dispatcher.d.ts +136 -139
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/node_modules/undici-types/errors.d.ts +92 -54
- package/node_modules/undici-types/eventsource.d.ts +9 -4
- package/node_modules/undici-types/fetch.d.ts +51 -25
- package/node_modules/undici-types/formdata.d.ts +7 -7
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +10 -9
- package/node_modules/undici-types/header.d.ts +162 -1
- package/node_modules/undici-types/index.d.ts +69 -47
- package/node_modules/undici-types/interceptors.d.ts +72 -9
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +26 -21
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -4
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +14 -14
- package/node_modules/undici-types/proxy-agent.d.ts +14 -6
- package/node_modules/undici-types/readable.d.ts +19 -16
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +148 -30
- package/node_modules/undici-types/websocket.d.ts +48 -10
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +14 -30
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +1 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +2 -11
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -4
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +53 -137
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +70 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +87 -35
- package/node_modules/zod/src/v4/core/api.ts +21 -29
- package/node_modules/zod/src/v4/core/checks.ts +61 -1
- package/node_modules/zod/src/v4/core/compile.ts +35 -24
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +9 -63
- package/node_modules/zod/src/v4/core/memoizer.ts +2 -5
- package/node_modules/zod/src/v4/core/regexes.ts +4 -0
- package/node_modules/zod/src/v4/core/schemas.ts +36 -109
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +177 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +1 -1
- package/node_modules/zod/src/v4/core/util.ts +0 -4
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/src/v4/core/visit.ts +0 -11
- package/node_modules/zod/src/v4/locales/ar.ts +1 -0
- package/node_modules/zod/src/v4/locales/az.ts +1 -0
- package/node_modules/zod/src/v4/locales/be.ts +1 -0
- package/node_modules/zod/src/v4/locales/bg.ts +1 -0
- package/node_modules/zod/src/v4/locales/bn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ca.ts +1 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +1 -0
- package/node_modules/zod/src/v4/locales/cs.ts +1 -0
- package/node_modules/zod/src/v4/locales/da.ts +1 -0
- package/node_modules/zod/src/v4/locales/de.ts +1 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +1 -0
- package/node_modules/zod/src/v4/locales/eo.ts +1 -0
- package/node_modules/zod/src/v4/locales/es.ts +1 -0
- package/node_modules/zod/src/v4/locales/fa.ts +1 -0
- package/node_modules/zod/src/v4/locales/fi.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr.ts +1 -0
- package/node_modules/zod/src/v4/locales/gu.ts +1 -0
- package/node_modules/zod/src/v4/locales/he.ts +1 -0
- package/node_modules/zod/src/v4/locales/hi.ts +1 -0
- package/node_modules/zod/src/v4/locales/hr.ts +1 -0
- package/node_modules/zod/src/v4/locales/hu.ts +1 -0
- package/node_modules/zod/src/v4/locales/hy.ts +1 -0
- package/node_modules/zod/src/v4/locales/id.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +1 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -0
- package/node_modules/zod/src/v4/locales/ja.ts +1 -0
- package/node_modules/zod/src/v4/locales/ka.ts +1 -0
- package/node_modules/zod/src/v4/locales/km.ts +1 -0
- package/node_modules/zod/src/v4/locales/kn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ko.ts +1 -0
- package/node_modules/zod/src/v4/locales/lt.ts +1 -0
- package/node_modules/zod/src/v4/locales/mk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ms.ts +1 -0
- package/node_modules/zod/src/v4/locales/ne.ts +1 -0
- package/node_modules/zod/src/v4/locales/nl.ts +1 -0
- package/node_modules/zod/src/v4/locales/nn.ts +1 -0
- package/node_modules/zod/src/v4/locales/no.ts +1 -0
- package/node_modules/zod/src/v4/locales/ota.ts +1 -0
- package/node_modules/zod/src/v4/locales/pl.ts +1 -0
- package/node_modules/zod/src/v4/locales/ps.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt.ts +1 -0
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +1 -0
- package/node_modules/zod/src/v4/locales/sk.ts +1 -0
- package/node_modules/zod/src/v4/locales/sl.ts +1 -0
- package/node_modules/zod/src/v4/locales/sv.ts +1 -0
- package/node_modules/zod/src/v4/locales/ta.ts +1 -0
- package/node_modules/zod/src/v4/locales/tg.ts +1 -0
- package/node_modules/zod/src/v4/locales/th.ts +1 -0
- package/node_modules/zod/src/v4/locales/tk.ts +1 -0
- package/node_modules/zod/src/v4/locales/tr.ts +1 -0
- package/node_modules/zod/src/v4/locales/uk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ur.ts +1 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +1 -0
- package/node_modules/zod/src/v4/locales/yo.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +1 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +12 -23
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +56 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +7 -0
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/schemas.cjs +11 -15
- package/node_modules/zod/v4/classic/schemas.d.cts +4 -6
- package/node_modules/zod/v4/classic/schemas.d.ts +4 -6
- package/node_modules/zod/v4/classic/schemas.js +9 -13
- package/node_modules/zod/v4/core/api.cjs +11 -23
- package/node_modules/zod/v4/core/api.d.cts +8 -4
- package/node_modules/zod/v4/core/api.d.ts +8 -4
- package/node_modules/zod/v4/core/api.js +11 -23
- package/node_modules/zod/v4/core/checks.cjs +32 -1
- package/node_modules/zod/v4/core/checks.d.cts +16 -0
- package/node_modules/zod/v4/core/checks.d.ts +16 -0
- package/node_modules/zod/v4/core/checks.js +31 -0
- package/node_modules/zod/v4/core/compile.cjs +12 -17
- package/node_modules/zod/v4/core/compile.js +13 -18
- package/node_modules/zod/v4/core/core.cjs +1 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/json-schema-processors.cjs +8 -44
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.js +8 -43
- package/node_modules/zod/v4/core/memoizer.cjs +2 -5
- package/node_modules/zod/v4/core/memoizer.js +2 -5
- package/node_modules/zod/v4/core/regexes.cjs +4 -2
- package/node_modules/zod/v4/core/regexes.d.cts +1 -0
- package/node_modules/zod/v4/core/regexes.d.ts +1 -0
- package/node_modules/zod/v4/core/regexes.js +2 -0
- package/node_modules/zod/v4/core/schemas.cjs +33 -73
- package/node_modules/zod/v4/core/schemas.d.cts +7 -22
- package/node_modules/zod/v4/core/schemas.d.ts +7 -22
- package/node_modules/zod/v4/core/schemas.js +30 -72
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -1
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.js +1 -1
- package/node_modules/zod/v4/core/util.cjs +0 -4
- package/node_modules/zod/v4/core/util.js +0 -4
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/node_modules/zod/v4/core/visit.cjs +0 -12
- package/node_modules/zod/v4/core/visit.js +0 -12
- package/node_modules/zod/v4/locales/ar.cjs +1 -0
- package/node_modules/zod/v4/locales/ar.js +1 -0
- package/node_modules/zod/v4/locales/az.cjs +1 -0
- package/node_modules/zod/v4/locales/az.js +1 -0
- package/node_modules/zod/v4/locales/be.cjs +1 -0
- package/node_modules/zod/v4/locales/be.js +1 -0
- package/node_modules/zod/v4/locales/bg.cjs +1 -0
- package/node_modules/zod/v4/locales/bg.js +1 -0
- package/node_modules/zod/v4/locales/bn.cjs +1 -0
- package/node_modules/zod/v4/locales/bn.js +1 -0
- package/node_modules/zod/v4/locales/ca.cjs +1 -0
- package/node_modules/zod/v4/locales/ca.js +1 -0
- package/node_modules/zod/v4/locales/ckb.cjs +1 -0
- package/node_modules/zod/v4/locales/ckb.js +1 -0
- package/node_modules/zod/v4/locales/cs.cjs +1 -0
- package/node_modules/zod/v4/locales/cs.js +1 -0
- package/node_modules/zod/v4/locales/da.cjs +1 -0
- package/node_modules/zod/v4/locales/da.js +1 -0
- package/node_modules/zod/v4/locales/de.cjs +1 -0
- package/node_modules/zod/v4/locales/de.js +1 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +1 -0
- package/node_modules/zod/v4/locales/en.js +1 -0
- package/node_modules/zod/v4/locales/eo.cjs +1 -0
- package/node_modules/zod/v4/locales/eo.js +1 -0
- package/node_modules/zod/v4/locales/es.cjs +1 -0
- package/node_modules/zod/v4/locales/es.js +1 -0
- package/node_modules/zod/v4/locales/fa.cjs +1 -0
- package/node_modules/zod/v4/locales/fa.js +1 -0
- package/node_modules/zod/v4/locales/fi.cjs +1 -0
- package/node_modules/zod/v4/locales/fi.js +1 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +1 -0
- package/node_modules/zod/v4/locales/fr-CA.js +1 -0
- package/node_modules/zod/v4/locales/fr.cjs +1 -0
- package/node_modules/zod/v4/locales/fr.js +1 -0
- package/node_modules/zod/v4/locales/gu.cjs +1 -0
- package/node_modules/zod/v4/locales/gu.js +1 -0
- package/node_modules/zod/v4/locales/he.cjs +1 -0
- package/node_modules/zod/v4/locales/he.js +1 -0
- package/node_modules/zod/v4/locales/hi.cjs +1 -0
- package/node_modules/zod/v4/locales/hi.js +1 -0
- package/node_modules/zod/v4/locales/hr.cjs +1 -0
- package/node_modules/zod/v4/locales/hr.js +1 -0
- package/node_modules/zod/v4/locales/hu.cjs +1 -0
- package/node_modules/zod/v4/locales/hu.js +1 -0
- package/node_modules/zod/v4/locales/hy.cjs +1 -0
- package/node_modules/zod/v4/locales/hy.js +1 -0
- package/node_modules/zod/v4/locales/id.cjs +1 -0
- package/node_modules/zod/v4/locales/id.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +1 -0
- package/node_modules/zod/v4/locales/is.js +1 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -0
- package/node_modules/zod/v4/locales/it.js +1 -0
- package/node_modules/zod/v4/locales/ja.cjs +1 -0
- package/node_modules/zod/v4/locales/ja.js +1 -0
- package/node_modules/zod/v4/locales/ka.cjs +1 -0
- package/node_modules/zod/v4/locales/ka.js +1 -0
- package/node_modules/zod/v4/locales/km.cjs +1 -0
- package/node_modules/zod/v4/locales/km.js +1 -0
- package/node_modules/zod/v4/locales/kn.cjs +1 -0
- package/node_modules/zod/v4/locales/kn.js +1 -0
- package/node_modules/zod/v4/locales/ko.cjs +1 -0
- package/node_modules/zod/v4/locales/ko.js +1 -0
- package/node_modules/zod/v4/locales/lt.cjs +1 -0
- package/node_modules/zod/v4/locales/lt.js +1 -0
- package/node_modules/zod/v4/locales/mk.cjs +1 -0
- package/node_modules/zod/v4/locales/mk.js +1 -0
- package/node_modules/zod/v4/locales/ms.cjs +1 -0
- package/node_modules/zod/v4/locales/ms.js +1 -0
- package/node_modules/zod/v4/locales/ne.cjs +1 -0
- package/node_modules/zod/v4/locales/ne.js +1 -0
- package/node_modules/zod/v4/locales/nl.cjs +1 -0
- package/node_modules/zod/v4/locales/nl.js +1 -0
- package/node_modules/zod/v4/locales/nn.cjs +1 -0
- package/node_modules/zod/v4/locales/nn.js +1 -0
- package/node_modules/zod/v4/locales/no.cjs +1 -0
- package/node_modules/zod/v4/locales/no.js +1 -0
- package/node_modules/zod/v4/locales/ota.cjs +1 -0
- package/node_modules/zod/v4/locales/ota.js +1 -0
- package/node_modules/zod/v4/locales/pl.cjs +1 -0
- package/node_modules/zod/v4/locales/pl.js +1 -0
- package/node_modules/zod/v4/locales/ps.cjs +1 -0
- package/node_modules/zod/v4/locales/ps.js +1 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +1 -0
- package/node_modules/zod/v4/locales/pt-BR.js +1 -0
- package/node_modules/zod/v4/locales/pt.cjs +1 -0
- package/node_modules/zod/v4/locales/pt.js +1 -0
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +1 -0
- package/node_modules/zod/v4/locales/ru.js +1 -0
- package/node_modules/zod/v4/locales/sk.cjs +1 -0
- package/node_modules/zod/v4/locales/sk.js +1 -0
- package/node_modules/zod/v4/locales/sl.cjs +1 -0
- package/node_modules/zod/v4/locales/sl.js +1 -0
- package/node_modules/zod/v4/locales/sv.cjs +1 -0
- package/node_modules/zod/v4/locales/sv.js +1 -0
- package/node_modules/zod/v4/locales/ta.cjs +1 -0
- package/node_modules/zod/v4/locales/ta.js +1 -0
- package/node_modules/zod/v4/locales/tg.cjs +1 -0
- package/node_modules/zod/v4/locales/tg.js +1 -0
- package/node_modules/zod/v4/locales/th.cjs +1 -0
- package/node_modules/zod/v4/locales/th.js +1 -0
- package/node_modules/zod/v4/locales/tk.cjs +1 -0
- package/node_modules/zod/v4/locales/tk.js +1 -0
- package/node_modules/zod/v4/locales/tr.cjs +1 -0
- package/node_modules/zod/v4/locales/tr.js +1 -0
- package/node_modules/zod/v4/locales/uk.cjs +1 -0
- package/node_modules/zod/v4/locales/uk.js +1 -0
- package/node_modules/zod/v4/locales/ur.cjs +1 -0
- package/node_modules/zod/v4/locales/ur.js +1 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +1 -0
- package/node_modules/zod/v4/locales/vi.js +1 -0
- package/node_modules/zod/v4/locales/yo.cjs +1 -0
- package/node_modules/zod/v4/locales/yo.js +1 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-CN.js +1 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-TW.js +1 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +11 -13
- package/node_modules/zod/v4/mini/schemas.d.cts +1 -4
- package/node_modules/zod/v4/mini/schemas.d.ts +1 -4
- package/node_modules/zod/v4/mini/schemas.js +9 -11
- package/package.json +2 -2
- package/slingshot/index.js +183 -182
- package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1,86 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:test` module facilitates the creation of JavaScript tests.
|
|
3
|
-
* To access it:
|
|
4
|
-
*
|
|
5
|
-
* ```js
|
|
6
|
-
* import test from 'node:test';
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* This module is only available under the `node:` scheme. The following will not
|
|
10
|
-
* work:
|
|
11
|
-
*
|
|
12
|
-
* ```js
|
|
13
|
-
* import test from 'node:test';
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* Tests created via the `test` module consist of a single function that is
|
|
17
|
-
* processed in one of three ways:
|
|
18
|
-
*
|
|
19
|
-
* 1. A synchronous function that is considered failing if it throws an exception,
|
|
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` fulfills.
|
|
22
|
-
* 3. A function that receives a callback function. If the callback receives any
|
|
23
|
-
* truthy value as its first argument, the test is considered failing. If a
|
|
24
|
-
* falsy value is passed as the first argument to the callback, the test is
|
|
25
|
-
* considered passing. If the test function receives a callback function and
|
|
26
|
-
* also returns a `Promise`, the test will fail.
|
|
27
|
-
*
|
|
28
|
-
* The following example illustrates how tests are written using the `test` module.
|
|
29
|
-
*
|
|
30
|
-
* ```js
|
|
31
|
-
* test('synchronous passing test', (t) => {
|
|
32
|
-
* // This test passes because it does not throw an exception.
|
|
33
|
-
* assert.strictEqual(1, 1);
|
|
34
|
-
* });
|
|
35
|
-
*
|
|
36
|
-
* test('synchronous failing test', (t) => {
|
|
37
|
-
* // This test fails because it throws an exception.
|
|
38
|
-
* assert.strictEqual(1, 2);
|
|
39
|
-
* });
|
|
40
|
-
*
|
|
41
|
-
* test('asynchronous passing test', async (t) => {
|
|
42
|
-
* // This test passes because the Promise returned by the async
|
|
43
|
-
* // function is settled and not rejected.
|
|
44
|
-
* assert.strictEqual(1, 1);
|
|
45
|
-
* });
|
|
46
|
-
*
|
|
47
|
-
* test('asynchronous failing test', async (t) => {
|
|
48
|
-
* // This test fails because the Promise returned by the async
|
|
49
|
-
* // function is rejected.
|
|
50
|
-
* assert.strictEqual(1, 2);
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* test('failing test using Promises', (t) => {
|
|
54
|
-
* // Promises can be used directly as well.
|
|
55
|
-
* return new Promise((resolve, reject) => {
|
|
56
|
-
* setImmediate(() => {
|
|
57
|
-
* reject(new Error('this will cause the test to fail'));
|
|
58
|
-
* });
|
|
59
|
-
* });
|
|
60
|
-
* });
|
|
61
|
-
*
|
|
62
|
-
* test('callback passing test', (t, done) => {
|
|
63
|
-
* // done() is the callback function. When the setImmediate() runs, it invokes
|
|
64
|
-
* // done() with no arguments.
|
|
65
|
-
* setImmediate(done);
|
|
66
|
-
* });
|
|
67
|
-
*
|
|
68
|
-
* test('callback failing test', (t, done) => {
|
|
69
|
-
* // When the setImmediate() runs, done() is invoked with an Error object and
|
|
70
|
-
* // the test fails.
|
|
71
|
-
* setImmediate(() => {
|
|
72
|
-
* done(new Error('callback failure'));
|
|
73
|
-
* });
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* If any tests fail, the process exit code is set to `1`.
|
|
78
|
-
* @since v18.0.0, v16.17.0
|
|
79
|
-
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/test.js)
|
|
80
|
-
*/
|
|
81
1
|
declare module "node:test" {
|
|
82
|
-
import { AssertMethodNames } from "node:assert";
|
|
83
|
-
import { Readable } from "node:stream";
|
|
2
|
+
import { AssertMethodNames, AssertPredicate } from "node:assert";
|
|
3
|
+
import { Readable, ReadableEventMap } from "node:stream";
|
|
4
|
+
import { TestEvent } from "node:test/reporters";
|
|
84
5
|
import { URL } from "node:url";
|
|
85
6
|
import TestFn = test.TestFn;
|
|
86
7
|
import TestOptions = test.TestOptions;
|
|
@@ -190,6 +111,16 @@ declare module "node:test" {
|
|
|
190
111
|
function only(name?: string, fn?: SuiteFn): Promise<void>;
|
|
191
112
|
function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
192
113
|
function only(fn?: SuiteFn): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* This flips the pass/fail reporting for a specific test or suite: a flagged test
|
|
116
|
+
* case must throw in order to pass, and a flagged test case that does not throw
|
|
117
|
+
* fails.
|
|
118
|
+
* @since v25.5.0
|
|
119
|
+
*/
|
|
120
|
+
function expectFailure(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
121
|
+
function expectFailure(name?: string, fn?: SuiteFn): Promise<void>;
|
|
122
|
+
function expectFailure(options?: TestOptions, fn?: SuiteFn): Promise<void>;
|
|
123
|
+
function expectFailure(fn?: SuiteFn): Promise<void>;
|
|
193
124
|
}
|
|
194
125
|
/**
|
|
195
126
|
* Shorthand for skipping a test. This is the same as calling {@link test} with `options.skip` set to `true`.
|
|
@@ -215,6 +146,11 @@ declare module "node:test" {
|
|
|
215
146
|
function only(name?: string, fn?: TestFn): Promise<void>;
|
|
216
147
|
function only(options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
217
148
|
function only(fn?: TestFn): Promise<void>;
|
|
149
|
+
// added in v25.5.0, undocumented
|
|
150
|
+
function expectFailure(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
151
|
+
function expectFailure(name?: string, fn?: TestFn): Promise<void>;
|
|
152
|
+
function expectFailure(options?: TestOptions, fn?: TestFn): Promise<void>;
|
|
153
|
+
function expectFailure(fn?: TestFn): Promise<void>;
|
|
218
154
|
/**
|
|
219
155
|
* The type of a function passed to {@link test}. The first argument to this function is a {@link TestContext} object.
|
|
220
156
|
* If the test uses callbacks, the callback function is passed as the second argument.
|
|
@@ -236,14 +172,22 @@ declare module "node:test" {
|
|
|
236
172
|
}
|
|
237
173
|
interface RunOptions {
|
|
238
174
|
/**
|
|
239
|
-
* If a number is provided, then that many
|
|
175
|
+
* If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop).
|
|
240
176
|
* If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time.
|
|
241
177
|
* @default false
|
|
242
178
|
*/
|
|
243
179
|
concurrency?: number | boolean | undefined;
|
|
244
180
|
/**
|
|
245
|
-
*
|
|
246
|
-
*
|
|
181
|
+
* Specifies the current working directory to be used by the test runner.
|
|
182
|
+
* Serves as the base path for resolving files according to the
|
|
183
|
+
* [test runner execution model](https://nodejs.org/docs/latest-v26.x/api/test.html#test-runner-execution-model).
|
|
184
|
+
* @since v23.0.0
|
|
185
|
+
* @default process.cwd()
|
|
186
|
+
*/
|
|
187
|
+
cwd?: string | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* An array containing the list of files to run. If omitted, files are run according to the
|
|
190
|
+
* [test runner execution model](https://nodejs.org/docs/latest-v26.x/api/test.html#test-runner-execution-model).
|
|
247
191
|
*/
|
|
248
192
|
files?: readonly string[] | undefined;
|
|
249
193
|
/**
|
|
@@ -255,8 +199,8 @@ declare module "node:test" {
|
|
|
255
199
|
forceExit?: boolean | undefined;
|
|
256
200
|
/**
|
|
257
201
|
* An array containing the list of glob patterns to match test files.
|
|
258
|
-
* This option cannot be used together with `files`.
|
|
259
|
-
*
|
|
202
|
+
* This option cannot be used together with `files`. If omitted, files are run according to the
|
|
203
|
+
* [test runner execution model](https://nodejs.org/docs/latest-v26.x/api/test.html#test-runner-execution-model).
|
|
260
204
|
* @since v22.6.0
|
|
261
205
|
*/
|
|
262
206
|
globPatterns?: readonly string[] | undefined;
|
|
@@ -320,6 +264,15 @@ declare module "node:test" {
|
|
|
320
264
|
* @since v22.1.0
|
|
321
265
|
*/
|
|
322
266
|
testSkipPatterns?: string | RegExp | ReadonlyArray<string | RegExp> | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* A tag name, or an array of tag names,
|
|
269
|
+
* used to filter tests by their declared tags. Tests must contain every
|
|
270
|
+
* listed tag to run. Equivalent to passing `--experimental-test-tag-filter`
|
|
271
|
+
* on the command line. See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
272
|
+
* @default undefined
|
|
273
|
+
* @since v26.2.0
|
|
274
|
+
*/
|
|
275
|
+
testTagFilters?: string | readonly string[] | undefined;
|
|
323
276
|
/**
|
|
324
277
|
* The number of milliseconds after which the test execution will fail.
|
|
325
278
|
* If unspecified, subtests inherit this value from their parent.
|
|
@@ -337,7 +290,28 @@ declare module "node:test" {
|
|
|
337
290
|
*/
|
|
338
291
|
shard?: TestShard | undefined;
|
|
339
292
|
/**
|
|
340
|
-
*
|
|
293
|
+
* Randomize execution order for test files and queued tests.
|
|
294
|
+
* This option is not supported with `watch: true`.
|
|
295
|
+
* @since v26.1.0
|
|
296
|
+
* @default false
|
|
297
|
+
*/
|
|
298
|
+
randomize?: boolean | undefined;
|
|
299
|
+
/**
|
|
300
|
+
* Seed used when randomizing execution order. If this
|
|
301
|
+
* option is set, runs can replay the same randomized order deterministically,
|
|
302
|
+
* and setting this option also enables randomization. The value must be an
|
|
303
|
+
* integer between `0` and `4294967295`.
|
|
304
|
+
*/
|
|
305
|
+
randomSeed?: number | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* A file path where the test runner will
|
|
308
|
+
* store the state of the tests to allow rerunning only the failed tests on a next run.
|
|
309
|
+
* @since v24.7.0
|
|
310
|
+
* @default undefined
|
|
311
|
+
*/
|
|
312
|
+
rerunFailuresFilePath?: string | undefined;
|
|
313
|
+
/**
|
|
314
|
+
* enable [code coverage](https://nodejs.org/docs/latest-v26.x/api/test.html#collecting-code-coverage) collection.
|
|
341
315
|
* @since v22.10.0
|
|
342
316
|
* @default false
|
|
343
317
|
*/
|
|
@@ -383,6 +357,32 @@ declare module "node:test" {
|
|
|
383
357
|
* @default 0
|
|
384
358
|
*/
|
|
385
359
|
functionCoverage?: number | undefined;
|
|
360
|
+
/**
|
|
361
|
+
* Specify environment variables to be passed along to the test process.
|
|
362
|
+
* This option is not compatible with `isolation='none'`. These variables will override
|
|
363
|
+
* those from the main process, and are not merged with `process.env`.
|
|
364
|
+
* @since v25.6.0
|
|
365
|
+
* @default process.env
|
|
366
|
+
*/
|
|
367
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
368
|
+
}
|
|
369
|
+
interface TestsStreamEventMap extends ReadableEventMap {
|
|
370
|
+
"data": [data: TestEvent];
|
|
371
|
+
"test:coverage": [data: EventData.TestCoverage];
|
|
372
|
+
"test:complete": [data: EventData.TestComplete];
|
|
373
|
+
"test:dequeue": [data: EventData.TestDequeue];
|
|
374
|
+
"test:diagnostic": [data: EventData.TestDiagnostic];
|
|
375
|
+
"test:enqueue": [data: EventData.TestEnqueue];
|
|
376
|
+
"test:fail": [data: EventData.TestFail];
|
|
377
|
+
"test:interrupted": [data: EventData.TestInterrupted];
|
|
378
|
+
"test:pass": [data: EventData.TestPass];
|
|
379
|
+
"test:plan": [data: EventData.TestPlan];
|
|
380
|
+
"test:start": [data: EventData.TestStart];
|
|
381
|
+
"test:stderr": [data: EventData.TestStderr];
|
|
382
|
+
"test:stdout": [data: EventData.TestStdout];
|
|
383
|
+
"test:summary": [data: EventData.TestSummary];
|
|
384
|
+
"test:watch:drained": [];
|
|
385
|
+
"test:watch:restarted": [];
|
|
386
386
|
}
|
|
387
387
|
/**
|
|
388
388
|
* A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.
|
|
@@ -391,94 +391,63 @@ declare module "node:test" {
|
|
|
391
391
|
* @since v18.9.0, v16.19.0
|
|
392
392
|
*/
|
|
393
393
|
interface TestsStream extends Readable {
|
|
394
|
-
|
|
395
|
-
addListener
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
addListener(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
once(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
448
|
-
once(event: "test:watch:drained", listener: () => void): this;
|
|
449
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
450
|
-
prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
451
|
-
prependListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
452
|
-
prependListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
|
|
453
|
-
prependListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
|
|
454
|
-
prependListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
|
|
455
|
-
prependListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
|
|
456
|
-
prependListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
|
|
457
|
-
prependListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
|
|
458
|
-
prependListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
|
|
459
|
-
prependListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
|
|
460
|
-
prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
461
|
-
prependListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
462
|
-
prependListener(event: "test:watch:drained", listener: () => void): this;
|
|
463
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
464
|
-
prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
465
|
-
prependOnceListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
466
|
-
prependOnceListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
|
|
467
|
-
prependOnceListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
|
|
468
|
-
prependOnceListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
|
|
469
|
-
prependOnceListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
|
|
470
|
-
prependOnceListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
|
|
471
|
-
prependOnceListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
|
|
472
|
-
prependOnceListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
|
|
473
|
-
prependOnceListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
|
|
474
|
-
prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
475
|
-
prependOnceListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
476
|
-
prependOnceListener(event: "test:watch:drained", listener: () => void): this;
|
|
477
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
394
|
+
// #region InternalEventEmitter
|
|
395
|
+
addListener<E extends keyof TestsStreamEventMap>(
|
|
396
|
+
eventName: E,
|
|
397
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
398
|
+
): this;
|
|
399
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
400
|
+
emit<E extends keyof TestsStreamEventMap>(eventName: E, ...args: TestsStreamEventMap[E]): boolean;
|
|
401
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
402
|
+
listenerCount<E extends keyof TestsStreamEventMap>(
|
|
403
|
+
eventName: E,
|
|
404
|
+
listener?: (...args: TestsStreamEventMap[E]) => void,
|
|
405
|
+
): number;
|
|
406
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
407
|
+
listeners<E extends keyof TestsStreamEventMap>(eventName: E): ((...args: TestsStreamEventMap[E]) => void)[];
|
|
408
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
409
|
+
off<E extends keyof TestsStreamEventMap>(
|
|
410
|
+
eventName: E,
|
|
411
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
412
|
+
): this;
|
|
413
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
414
|
+
on<E extends keyof TestsStreamEventMap>(
|
|
415
|
+
eventName: E,
|
|
416
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
417
|
+
): this;
|
|
418
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
419
|
+
once<E extends keyof TestsStreamEventMap>(
|
|
420
|
+
eventName: E,
|
|
421
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
422
|
+
): this;
|
|
423
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
424
|
+
prependListener<E extends keyof TestsStreamEventMap>(
|
|
425
|
+
eventName: E,
|
|
426
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
427
|
+
): this;
|
|
428
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
429
|
+
prependOnceListener<E extends keyof TestsStreamEventMap>(
|
|
430
|
+
eventName: E,
|
|
431
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
432
|
+
): this;
|
|
433
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
434
|
+
rawListeners<E extends keyof TestsStreamEventMap>(
|
|
435
|
+
eventName: E,
|
|
436
|
+
): ((...args: TestsStreamEventMap[E]) => void)[];
|
|
437
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
438
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
439
|
+
removeAllListeners<E extends keyof TestsStreamEventMap>(eventName?: E): this;
|
|
440
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
441
|
+
removeListener<E extends keyof TestsStreamEventMap>(
|
|
442
|
+
eventName: E,
|
|
443
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
444
|
+
): this;
|
|
445
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
446
|
+
// #endregion
|
|
478
447
|
}
|
|
479
448
|
namespace EventData {
|
|
480
449
|
interface Error extends globalThis.Error {
|
|
481
|
-
cause:
|
|
450
|
+
cause: unknown;
|
|
482
451
|
}
|
|
483
452
|
interface LocationInfo {
|
|
484
453
|
/**
|
|
@@ -698,7 +667,7 @@ declare module "node:test" {
|
|
|
698
667
|
/**
|
|
699
668
|
* The type of the test, used to denote whether this is a suite.
|
|
700
669
|
*/
|
|
701
|
-
type?: "suite";
|
|
670
|
+
type?: "suite" | "test";
|
|
702
671
|
};
|
|
703
672
|
/**
|
|
704
673
|
* The test name.
|
|
@@ -708,6 +677,24 @@ declare module "node:test" {
|
|
|
708
677
|
* The nesting level of the test.
|
|
709
678
|
*/
|
|
710
679
|
nesting: number;
|
|
680
|
+
/**
|
|
681
|
+
* The `testId` of the enclosing test, or
|
|
682
|
+
* `undefined` for top-level tests. Lets custom reporters track lineage
|
|
683
|
+
* when concurrent siblings at the same nesting level interleave.
|
|
684
|
+
*/
|
|
685
|
+
parentId: number | undefined;
|
|
686
|
+
/**
|
|
687
|
+
* The flattened lowercased tags declared on the test
|
|
688
|
+
* and its ancestor suites, in declaration order. Empty for untagged tests.
|
|
689
|
+
* See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
690
|
+
*/
|
|
691
|
+
tags: string[];
|
|
692
|
+
/**
|
|
693
|
+
* A numeric identifier for this test instance, unique
|
|
694
|
+
* within the test file's process. Consistent across all events for the same
|
|
695
|
+
* test instance, enabling reliable correlation in custom reporters.
|
|
696
|
+
*/
|
|
697
|
+
testId: number;
|
|
711
698
|
/**
|
|
712
699
|
* The ordinal number of the test.
|
|
713
700
|
*/
|
|
@@ -730,6 +717,24 @@ declare module "node:test" {
|
|
|
730
717
|
* The nesting level of the test.
|
|
731
718
|
*/
|
|
732
719
|
nesting: number;
|
|
720
|
+
/**
|
|
721
|
+
* The `testId` of the enclosing test, or
|
|
722
|
+
* `undefined` for top-level tests. Lets custom reporters track lineage
|
|
723
|
+
* when concurrent siblings at the same nesting level interleave.
|
|
724
|
+
*/
|
|
725
|
+
parentId: number | undefined;
|
|
726
|
+
/**
|
|
727
|
+
* The flattened lowercased tags declared on the test
|
|
728
|
+
* and its ancestor suites, in declaration order. Empty for untagged tests.
|
|
729
|
+
* See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
730
|
+
*/
|
|
731
|
+
tags: string[];
|
|
732
|
+
/**
|
|
733
|
+
* A numeric identifier for this test instance, unique
|
|
734
|
+
* within the test file's process. Consistent across all events for the same
|
|
735
|
+
* test instance, enabling reliable correlation in custom reporters.
|
|
736
|
+
*/
|
|
737
|
+
testId: number;
|
|
733
738
|
/**
|
|
734
739
|
* The test type. Either `'suite'` or `'test'`.
|
|
735
740
|
* @since v22.15.0
|
|
@@ -745,6 +750,24 @@ declare module "node:test" {
|
|
|
745
750
|
* The nesting level of the test.
|
|
746
751
|
*/
|
|
747
752
|
nesting: number;
|
|
753
|
+
/**
|
|
754
|
+
* The `testId` of the enclosing test, or
|
|
755
|
+
* `undefined` for top-level tests. Lets custom reporters track lineage
|
|
756
|
+
* when concurrent siblings at the same nesting level interleave.
|
|
757
|
+
*/
|
|
758
|
+
parentId: number | undefined;
|
|
759
|
+
/**
|
|
760
|
+
* The flattened lowercased tags declared on the test
|
|
761
|
+
* and its ancestor suites, in declaration order. Empty for untagged tests.
|
|
762
|
+
* See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
763
|
+
*/
|
|
764
|
+
tags: string[];
|
|
765
|
+
/**
|
|
766
|
+
* A numeric identifier for this test instance, unique
|
|
767
|
+
* within the test file's process. Consistent across all events for the same
|
|
768
|
+
* test instance, enabling reliable correlation in custom reporters.
|
|
769
|
+
*/
|
|
770
|
+
testId: number;
|
|
748
771
|
/**
|
|
749
772
|
* The test type. Either `'suite'` or `'test'`.
|
|
750
773
|
* @since v22.15.0
|
|
@@ -768,7 +791,13 @@ declare module "node:test" {
|
|
|
768
791
|
* The type of the test, used to denote whether this is a suite.
|
|
769
792
|
* @since v20.0.0, v19.9.0, v18.17.0
|
|
770
793
|
*/
|
|
771
|
-
type?: "suite";
|
|
794
|
+
type?: "suite" | "test";
|
|
795
|
+
/**
|
|
796
|
+
* The attempt number of the test run,
|
|
797
|
+
* present only when using the `--test-rerun-failures` flag.
|
|
798
|
+
* @since v24.7.0
|
|
799
|
+
*/
|
|
800
|
+
attempt?: number;
|
|
772
801
|
};
|
|
773
802
|
/**
|
|
774
803
|
* The test name.
|
|
@@ -778,6 +807,24 @@ declare module "node:test" {
|
|
|
778
807
|
* The nesting level of the test.
|
|
779
808
|
*/
|
|
780
809
|
nesting: number;
|
|
810
|
+
/**
|
|
811
|
+
* The `testId` of the enclosing test, or
|
|
812
|
+
* `undefined` for top-level tests. Lets custom reporters track lineage
|
|
813
|
+
* when concurrent siblings at the same nesting level interleave.
|
|
814
|
+
*/
|
|
815
|
+
parentId: number | undefined;
|
|
816
|
+
/**
|
|
817
|
+
* The flattened lowercased tags declared on the test
|
|
818
|
+
* and its ancestor suites, in declaration order. Empty for untagged tests.
|
|
819
|
+
* See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
820
|
+
*/
|
|
821
|
+
tags: string[];
|
|
822
|
+
/**
|
|
823
|
+
* A numeric identifier for this test instance, unique
|
|
824
|
+
* within the test file's process. Consistent across all events for the same
|
|
825
|
+
* test instance, enabling reliable correlation in custom reporters.
|
|
826
|
+
*/
|
|
827
|
+
testId: number;
|
|
781
828
|
/**
|
|
782
829
|
* The ordinal number of the test.
|
|
783
830
|
*/
|
|
@@ -791,6 +838,13 @@ declare module "node:test" {
|
|
|
791
838
|
*/
|
|
792
839
|
skip?: string | boolean;
|
|
793
840
|
}
|
|
841
|
+
interface TestInterrupted {
|
|
842
|
+
/**
|
|
843
|
+
* An array of objects containing information about the
|
|
844
|
+
* interrupted tests.
|
|
845
|
+
*/
|
|
846
|
+
tests: TestStart[];
|
|
847
|
+
}
|
|
794
848
|
interface TestPass extends LocationInfo {
|
|
795
849
|
/**
|
|
796
850
|
* Additional execution metadata.
|
|
@@ -804,7 +858,19 @@ declare module "node:test" {
|
|
|
804
858
|
* The type of the test, used to denote whether this is a suite.
|
|
805
859
|
* @since 20.0.0, 19.9.0, 18.17.0
|
|
806
860
|
*/
|
|
807
|
-
type?: "suite";
|
|
861
|
+
type?: "suite" | "test";
|
|
862
|
+
/**
|
|
863
|
+
* The attempt number of the test run,
|
|
864
|
+
* present only when using the `--test-rerun-failures` flag.
|
|
865
|
+
* @since v24.7.0
|
|
866
|
+
*/
|
|
867
|
+
attempt?: number;
|
|
868
|
+
/**
|
|
869
|
+
* The attempt number the test passed on,
|
|
870
|
+
* present only when using the `--test-rerun-failures` flag.
|
|
871
|
+
* @since v24.7.0
|
|
872
|
+
*/
|
|
873
|
+
passed_on_attempt?: number;
|
|
808
874
|
};
|
|
809
875
|
/**
|
|
810
876
|
* The test name.
|
|
@@ -814,6 +880,24 @@ declare module "node:test" {
|
|
|
814
880
|
* The nesting level of the test.
|
|
815
881
|
*/
|
|
816
882
|
nesting: number;
|
|
883
|
+
/**
|
|
884
|
+
* The `testId` of the enclosing test, or
|
|
885
|
+
* `undefined` for top-level tests. Lets custom reporters track lineage
|
|
886
|
+
* when concurrent siblings at the same nesting level interleave.
|
|
887
|
+
*/
|
|
888
|
+
parentId: number | undefined;
|
|
889
|
+
/**
|
|
890
|
+
* The flattened lowercased tags declared on the test
|
|
891
|
+
* and its ancestor suites, in declaration order. Empty for untagged tests.
|
|
892
|
+
* See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
893
|
+
*/
|
|
894
|
+
tags: string[];
|
|
895
|
+
/**
|
|
896
|
+
* A numeric identifier for this test instance, unique
|
|
897
|
+
* within the test file's process. Consistent across all events for the same
|
|
898
|
+
* test instance, enabling reliable correlation in custom reporters.
|
|
899
|
+
*/
|
|
900
|
+
testId: number;
|
|
817
901
|
/**
|
|
818
902
|
* The ordinal number of the test.
|
|
819
903
|
*/
|
|
@@ -846,6 +930,24 @@ declare module "node:test" {
|
|
|
846
930
|
* The nesting level of the test.
|
|
847
931
|
*/
|
|
848
932
|
nesting: number;
|
|
933
|
+
/**
|
|
934
|
+
* The `testId` of the enclosing test, or
|
|
935
|
+
* `undefined` for top-level tests. Lets custom reporters track lineage
|
|
936
|
+
* when concurrent siblings at the same nesting level interleave.
|
|
937
|
+
*/
|
|
938
|
+
parentId: number | undefined;
|
|
939
|
+
/**
|
|
940
|
+
* The flattened lowercased tags declared on the test
|
|
941
|
+
* and its ancestor suites, in declaration order. Empty for untagged tests.
|
|
942
|
+
* See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
943
|
+
*/
|
|
944
|
+
tags: string[];
|
|
945
|
+
/**
|
|
946
|
+
* A numeric identifier for this test instance, unique
|
|
947
|
+
* within the test file's process. Consistent across all events for the same
|
|
948
|
+
* test instance, enabling reliable correlation in custom reporters.
|
|
949
|
+
*/
|
|
950
|
+
testId: number;
|
|
849
951
|
}
|
|
850
952
|
interface TestStderr {
|
|
851
953
|
/**
|
|
@@ -919,6 +1021,39 @@ declare module "node:test" {
|
|
|
919
1021
|
success: boolean;
|
|
920
1022
|
}
|
|
921
1023
|
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Returns the {@link TestContext} or {@link SuiteContext} object associated with the
|
|
1026
|
+
* currently executing test or suite, or `undefined` if called outside of a test or
|
|
1027
|
+
* suite. This function can be used to access context information from within the
|
|
1028
|
+
* test or suite function or any async operations within them.
|
|
1029
|
+
|
|
1030
|
+
* ```js
|
|
1031
|
+
* import { getTestContext } from 'node:test';
|
|
1032
|
+
*
|
|
1033
|
+
* test('example test', async () => {
|
|
1034
|
+
* const ctx = getTestContext();
|
|
1035
|
+
* console.log(`Running test: ${ctx.name}`);
|
|
1036
|
+
* });
|
|
1037
|
+
*
|
|
1038
|
+
* describe('example suite', () => {
|
|
1039
|
+
* const ctx = getTestContext();
|
|
1040
|
+
* console.log(`Running suite: ${ctx.name}`);
|
|
1041
|
+
* });
|
|
1042
|
+
* ```
|
|
1043
|
+
*
|
|
1044
|
+
* When called from a test, returns a `TestContext`.
|
|
1045
|
+
* When called from a suite, returns a `SuiteContext`.
|
|
1046
|
+
*
|
|
1047
|
+
* If called from outside a test or suite (e.g., at the top level of a module or in
|
|
1048
|
+
* a setTimeout callback after execution has completed), this function returns
|
|
1049
|
+
* `undefined`.
|
|
1050
|
+
*
|
|
1051
|
+
* When called from within a hook (before, beforeEach, after, afterEach), this
|
|
1052
|
+
* function returns the context of the test or suite that the hook is associated
|
|
1053
|
+
* with.
|
|
1054
|
+
* @since v26.1.0
|
|
1055
|
+
*/
|
|
1056
|
+
function getTestContext(): TestContext | SuiteContext | undefined;
|
|
922
1057
|
/**
|
|
923
1058
|
* An instance of `TestContext` is passed to each test function in order to
|
|
924
1059
|
* interact with the test runner. However, the `TestContext` constructor is not
|
|
@@ -1011,6 +1146,58 @@ declare module "node:test" {
|
|
|
1011
1146
|
* @since v18.8.0, v16.18.0
|
|
1012
1147
|
*/
|
|
1013
1148
|
readonly name: string;
|
|
1149
|
+
/**
|
|
1150
|
+
* Indicated whether the test succeeded.
|
|
1151
|
+
* @since v21.7.0, v20.12.0
|
|
1152
|
+
*/
|
|
1153
|
+
readonly passed: boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* The failure reason for the test/case; wrapped and available via `context.error.cause`.
|
|
1156
|
+
* @since v21.7.0, v20.12.0
|
|
1157
|
+
*/
|
|
1158
|
+
readonly error: EventData.Error | null;
|
|
1159
|
+
/**
|
|
1160
|
+
* The attempt number of the test. This value is zero-based, so the first attempt is `0`,
|
|
1161
|
+
* the second attempt is `1`, and so on. This property is useful in conjunction with the
|
|
1162
|
+
* `--test-rerun-failures` option to determine which attempt the test is currently running.
|
|
1163
|
+
* @since v21.7.0, v20.12.0
|
|
1164
|
+
*/
|
|
1165
|
+
readonly attempt: number;
|
|
1166
|
+
/**
|
|
1167
|
+
* A frozen array of the test's flattened lowercased tags, in declaration
|
|
1168
|
+
* order, including any tags inherited from ancestor suites. Empty when the
|
|
1169
|
+
* test has no tags. See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
1170
|
+
* @since v26.2.0
|
|
1171
|
+
*/
|
|
1172
|
+
readonly tags: readonly string[];
|
|
1173
|
+
/**
|
|
1174
|
+
* The unique identifier of the worker running the current test file. This value is
|
|
1175
|
+
* derived from the `NODE_TEST_WORKER_ID` environment variable. When running tests
|
|
1176
|
+
* with `--test-isolation=process` (the default), each test file runs in a separate
|
|
1177
|
+
* child process and is assigned a worker ID from 1 to N, where N is the number of
|
|
1178
|
+
* concurrent workers. When running with `--test-isolation=none`, all tests run in
|
|
1179
|
+
* the same process and the worker ID is always 1. This value is `undefined` when
|
|
1180
|
+
* not running in a test context.
|
|
1181
|
+
*
|
|
1182
|
+
* This property is useful for splitting resources (like database connections or
|
|
1183
|
+
* server ports) across concurrent test files:
|
|
1184
|
+
*
|
|
1185
|
+
* ```js
|
|
1186
|
+
* import { test } from 'node:test';
|
|
1187
|
+
* import { process } from 'node:process';
|
|
1188
|
+
*
|
|
1189
|
+
* test('database operations', async (t) => {
|
|
1190
|
+
* // Worker ID is available via context
|
|
1191
|
+
* console.log(`Running in worker ${t.workerId}`);
|
|
1192
|
+
*
|
|
1193
|
+
* // Or via environment variable (available at import time)
|
|
1194
|
+
* const workerId = process.env.NODE_TEST_WORKER_ID;
|
|
1195
|
+
* // Use workerId to allocate separate resources per worker
|
|
1196
|
+
* });
|
|
1197
|
+
* ```
|
|
1198
|
+
* @since v25.8.0
|
|
1199
|
+
*/
|
|
1200
|
+
readonly workerId: number | undefined;
|
|
1014
1201
|
/**
|
|
1015
1202
|
* This function is used to set the number of assertions and subtests that are expected to run
|
|
1016
1203
|
* within the test. If the number of assertions and subtests that run does not match the
|
|
@@ -1179,7 +1366,7 @@ declare module "node:test" {
|
|
|
1179
1366
|
* highlighting.
|
|
1180
1367
|
* @since v22.14.0
|
|
1181
1368
|
* @param value A value to serialize to a string. If Node.js was started with
|
|
1182
|
-
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-
|
|
1369
|
+
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v26.x/api/cli.html#--test-update-snapshots)
|
|
1183
1370
|
* flag, the serialized value is written to
|
|
1184
1371
|
* `path`. Otherwise, the serialized value is compared to the contents of the
|
|
1185
1372
|
* existing snapshot file.
|
|
@@ -1202,7 +1389,7 @@ declare module "node:test" {
|
|
|
1202
1389
|
* ```
|
|
1203
1390
|
* @since v22.3.0
|
|
1204
1391
|
* @param value A value to serialize to a string. If Node.js was started with
|
|
1205
|
-
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-
|
|
1392
|
+
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v26.x/api/cli.html#--test-update-snapshots)
|
|
1206
1393
|
* flag, the serialized value is written to
|
|
1207
1394
|
* the snapshot file. Otherwise, the serialized value is compared to the
|
|
1208
1395
|
* corresponding value in the existing snapshot file.
|
|
@@ -1265,6 +1452,11 @@ declare module "node:test" {
|
|
|
1265
1452
|
* @since v22.6.0
|
|
1266
1453
|
*/
|
|
1267
1454
|
readonly filePath: string | undefined;
|
|
1455
|
+
/**
|
|
1456
|
+
* The name of the suite and each of its ancestors, separated by `>`.
|
|
1457
|
+
* @since v22.3.0, v20.16.0
|
|
1458
|
+
*/
|
|
1459
|
+
readonly fullName: string;
|
|
1268
1460
|
/**
|
|
1269
1461
|
* The name of the suite.
|
|
1270
1462
|
* @since v18.8.0, v16.18.0
|
|
@@ -1275,6 +1467,31 @@ declare module "node:test" {
|
|
|
1275
1467
|
* @since v18.7.0, v16.17.0
|
|
1276
1468
|
*/
|
|
1277
1469
|
readonly signal: AbortSignal;
|
|
1470
|
+
/**
|
|
1471
|
+
* Indicates whether the suite and all of its subtests have passed.
|
|
1472
|
+
* @since v26.1.0
|
|
1473
|
+
*/
|
|
1474
|
+
readonly passed: boolean;
|
|
1475
|
+
/**
|
|
1476
|
+
* The attempt number of the suite. This value is zero-based, so the first attempt is `0`,
|
|
1477
|
+
* the second attempt is `1`, and so on. This property is useful in conjunction with the
|
|
1478
|
+
* `--test-rerun-failures` option to determine the attempt number of the current run.
|
|
1479
|
+
* @since v26.1.0
|
|
1480
|
+
*/
|
|
1481
|
+
readonly attempt: number;
|
|
1482
|
+
/**
|
|
1483
|
+
* Output a diagnostic message. This is typically used for logging information
|
|
1484
|
+
* about the current suite or its tests.
|
|
1485
|
+
*
|
|
1486
|
+
* ```js
|
|
1487
|
+
* test.describe('my suite', (suite) => {
|
|
1488
|
+
* suite.diagnostic('Suite diagnostic message');
|
|
1489
|
+
* });
|
|
1490
|
+
* ```
|
|
1491
|
+
* @since v26.1.0
|
|
1492
|
+
* @param message A diagnostic message to output.
|
|
1493
|
+
*/
|
|
1494
|
+
diagnostic(message: string): void;
|
|
1278
1495
|
}
|
|
1279
1496
|
interface TestOptions {
|
|
1280
1497
|
/**
|
|
@@ -1286,6 +1503,17 @@ declare module "node:test" {
|
|
|
1286
1503
|
* @default false
|
|
1287
1504
|
*/
|
|
1288
1505
|
concurrency?: number | boolean | undefined;
|
|
1506
|
+
/**
|
|
1507
|
+
* If truthy, the test is expected to fail. If a non-empty string is provided, that string is displayed
|
|
1508
|
+
* in the test results as the reason why the test is expected to fail. If a
|
|
1509
|
+
* `RegExp`, `Function`, `Object`, or `Error` is provided directly (without wrapping in `{ match: … }`), the test passes
|
|
1510
|
+
* only if the thrown error matches, following the behavior of
|
|
1511
|
+
* `assert.throws`. To provide both a reason and validation, pass an object
|
|
1512
|
+
* with `label` (string) and `match` (RegExp, Function, Object, or Error).
|
|
1513
|
+
* @since v25.5.0
|
|
1514
|
+
* @default false
|
|
1515
|
+
*/
|
|
1516
|
+
expectFailure?: boolean | string | AssertPredicate | undefined;
|
|
1289
1517
|
/**
|
|
1290
1518
|
* If truthy, and the test context is configured to run `only` tests, then this test will be
|
|
1291
1519
|
* run. Otherwise, the test is skipped.
|
|
@@ -1303,6 +1531,15 @@ declare module "node:test" {
|
|
|
1303
1531
|
* @default false
|
|
1304
1532
|
*/
|
|
1305
1533
|
skip?: boolean | string | undefined;
|
|
1534
|
+
/**
|
|
1535
|
+
* An array of string labels associated with the test.
|
|
1536
|
+
* Used together with `--experimental-test-tag-filter` to filter which
|
|
1537
|
+
* tests run. Tags inherit from suites to nested tests by union. See
|
|
1538
|
+
* [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
|
|
1539
|
+
* @default []
|
|
1540
|
+
* @since v26.2.0
|
|
1541
|
+
*/
|
|
1542
|
+
tags?: readonly string[] | undefined;
|
|
1306
1543
|
/**
|
|
1307
1544
|
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this
|
|
1308
1545
|
* value from their parent.
|
|
@@ -1332,7 +1569,7 @@ declare module "node:test" {
|
|
|
1332
1569
|
* describe('tests', async () => {
|
|
1333
1570
|
* before(() => console.log('about to run some test'));
|
|
1334
1571
|
* it('is a subtest', () => {
|
|
1335
|
-
*
|
|
1572
|
+
* // Some relevant assertion here
|
|
1336
1573
|
* });
|
|
1337
1574
|
* });
|
|
1338
1575
|
* ```
|
|
@@ -1348,7 +1585,7 @@ declare module "node:test" {
|
|
|
1348
1585
|
* describe('tests', async () => {
|
|
1349
1586
|
* after(() => console.log('finished running tests'));
|
|
1350
1587
|
* it('is a subtest', () => {
|
|
1351
|
-
*
|
|
1588
|
+
* // Some relevant assertion here
|
|
1352
1589
|
* });
|
|
1353
1590
|
* });
|
|
1354
1591
|
* ```
|
|
@@ -1364,7 +1601,7 @@ declare module "node:test" {
|
|
|
1364
1601
|
* describe('tests', async () => {
|
|
1365
1602
|
* beforeEach(() => console.log('about to run a test'));
|
|
1366
1603
|
* it('is a subtest', () => {
|
|
1367
|
-
*
|
|
1604
|
+
* // Some relevant assertion here
|
|
1368
1605
|
* });
|
|
1369
1606
|
* });
|
|
1370
1607
|
* ```
|
|
@@ -1381,7 +1618,7 @@ declare module "node:test" {
|
|
|
1381
1618
|
* describe('tests', async () => {
|
|
1382
1619
|
* afterEach(() => console.log('finished running a test'));
|
|
1383
1620
|
* it('is a subtest', () => {
|
|
1384
|
-
*
|
|
1621
|
+
* // Some relevant assertion here
|
|
1385
1622
|
* });
|
|
1386
1623
|
* });
|
|
1387
1624
|
* ```
|
|
@@ -1449,19 +1686,40 @@ declare module "node:test" {
|
|
|
1449
1686
|
*/
|
|
1450
1687
|
cache?: boolean | undefined;
|
|
1451
1688
|
/**
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1454
|
-
*
|
|
1455
|
-
*
|
|
1456
|
-
* If
|
|
1689
|
+
* Optional mocked exports. The `default` property, if
|
|
1690
|
+
* provided, is used as the mocked module's default export. All other own
|
|
1691
|
+
* enumerable properties are used as named exports.
|
|
1692
|
+
* **This option cannot be used with `defaultExport` or `namedExports`.**
|
|
1693
|
+
* * If the mock is a CommonJS or builtin module, `exports.default` is used as
|
|
1694
|
+
* the value of `module.exports`.
|
|
1695
|
+
* * If `exports.default` is not provided for a CommonJS or builtin mock,
|
|
1696
|
+
* `module.exports` defaults to an empty object.
|
|
1697
|
+
* * If named exports are provided with a non-object default export, the mock
|
|
1698
|
+
* throws an exception when used as a CommonJS or builtin module.
|
|
1699
|
+
*/
|
|
1700
|
+
exports?: object | undefined;
|
|
1701
|
+
/**
|
|
1702
|
+
* An optional value used as the mocked module's default
|
|
1703
|
+
* export. If this value is not provided, ESM mocks do not include a default
|
|
1704
|
+
* export. If the mock is a CommonJS or builtin module, this setting is used as
|
|
1705
|
+
* the value of `module.exports`. If this value is not provided, CJS and builtin
|
|
1706
|
+
* mocks use an empty object as the value of `module.exports`.
|
|
1707
|
+
* **This option cannot be used with `options.exports`.**
|
|
1708
|
+
* This option is deprecated and will be removed in a later version.
|
|
1709
|
+
* Prefer `options.exports.default`.
|
|
1710
|
+
* @deprecated
|
|
1457
1711
|
*/
|
|
1458
1712
|
defaultExport?: any;
|
|
1459
1713
|
/**
|
|
1460
|
-
* An object whose keys and values are used to
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1464
|
-
*
|
|
1714
|
+
* An optional object whose keys and values are used to
|
|
1715
|
+
* create the named exports of the mock module. If the mock is a CommonJS or
|
|
1716
|
+
* builtin module, these values are copied onto `module.exports`. Therefore, if a
|
|
1717
|
+
* mock is created with both named exports and a non-object default export, the
|
|
1718
|
+
* mock will throw an exception when used as a CJS or builtin module.
|
|
1719
|
+
* **This option cannot be used with `options.exports`.**
|
|
1720
|
+
* This option is deprecated and will be removed in a later version.
|
|
1721
|
+
* Prefer `options.exports`.
|
|
1722
|
+
* @deprecated
|
|
1465
1723
|
*/
|
|
1466
1724
|
namedExports?: object | undefined;
|
|
1467
1725
|
}
|
|
@@ -1630,10 +1888,48 @@ declare module "node:test" {
|
|
|
1630
1888
|
options?: MockFunctionOptions,
|
|
1631
1889
|
): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
|
|
1632
1890
|
/**
|
|
1633
|
-
* This function is used to mock the exports of ECMAScript modules, CommonJS modules,
|
|
1634
|
-
* Any references to the original module prior to mocking are not impacted.
|
|
1891
|
+
* This function is used to mock the exports of ECMAScript modules, CommonJS modules, JSON modules, and
|
|
1892
|
+
* Node.js builtin modules. Any references to the original module prior to mocking are not impacted. In
|
|
1893
|
+
* order to enable module mocking, Node.js must be started with the
|
|
1894
|
+
* [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-v26.x/api/cli.html#--experimental-test-module-mocks)
|
|
1895
|
+
* command-line flag.
|
|
1896
|
+
*
|
|
1897
|
+
* **Note**: [module customization hooks](https://nodejs.org/docs/latest-v26.x/api/module.html#customization-hooks) registered via the **synchronous** API effect resolution of
|
|
1898
|
+
* the `specifier` provided to `mock.module`. Customization hooks registered via the **asynchronous**
|
|
1899
|
+
* API are currently ignored (because the test runner's loader is synchronous, and node does not
|
|
1900
|
+
* support multi-chain / cross-chain loading).
|
|
1901
|
+
*
|
|
1902
|
+
* The following example demonstrates how a mock is created for a module.
|
|
1903
|
+
*
|
|
1904
|
+
* ```js
|
|
1905
|
+
* test('mocks a builtin module in both module systems', async (t) => {
|
|
1906
|
+
* // Create a mock of 'node:readline' with a named export named 'foo', which
|
|
1907
|
+
* // does not exist in the original 'node:readline' module.
|
|
1908
|
+
* const mock = t.mock.module('node:readline', {
|
|
1909
|
+
* exports: { foo: () => 42 },
|
|
1910
|
+
* });
|
|
1911
|
+
*
|
|
1912
|
+
* let esmImpl = await import('node:readline');
|
|
1913
|
+
* let cjsImpl = require('node:readline');
|
|
1914
|
+
*
|
|
1915
|
+
* // cursorTo() is an export of the original 'node:readline' module.
|
|
1916
|
+
* assert.strictEqual(esmImpl.cursorTo, undefined);
|
|
1917
|
+
* assert.strictEqual(cjsImpl.cursorTo, undefined);
|
|
1918
|
+
* assert.strictEqual(esmImpl.fn(), 42);
|
|
1919
|
+
* assert.strictEqual(cjsImpl.fn(), 42);
|
|
1920
|
+
*
|
|
1921
|
+
* mock.restore();
|
|
1635
1922
|
*
|
|
1636
|
-
*
|
|
1923
|
+
* // The mock is restored, so the original builtin module is returned.
|
|
1924
|
+
* esmImpl = await import('node:readline');
|
|
1925
|
+
* cjsImpl = require('node:readline');
|
|
1926
|
+
*
|
|
1927
|
+
* assert.strictEqual(typeof esmImpl.cursorTo, 'function');
|
|
1928
|
+
* assert.strictEqual(typeof cjsImpl.cursorTo, 'function');
|
|
1929
|
+
* assert.strictEqual(esmImpl.fn, undefined);
|
|
1930
|
+
* assert.strictEqual(cjsImpl.fn, undefined);
|
|
1931
|
+
* });
|
|
1932
|
+
* ```
|
|
1637
1933
|
* @since v22.3.0
|
|
1638
1934
|
* @experimental
|
|
1639
1935
|
* @param specifier A string identifying the module to mock.
|
|
@@ -1663,14 +1959,14 @@ declare module "node:test" {
|
|
|
1663
1959
|
* assert.strictEqual(obj.foo, 42);
|
|
1664
1960
|
* });
|
|
1665
1961
|
* ```
|
|
1666
|
-
* @since
|
|
1962
|
+
* @since v24.3.0
|
|
1667
1963
|
* @param object The object whose value is being mocked.
|
|
1668
1964
|
* @param propertyName The identifier of the property on `object` to mock.
|
|
1669
1965
|
* @param value An optional value used as the mock value
|
|
1670
1966
|
* for `object[propertyName]`. **Default:** The original property value.
|
|
1671
1967
|
* @returns A proxy to the mocked object. The mocked object contains a
|
|
1672
|
-
* special `mock` property, which is an instance of [`MockPropertyContext`]
|
|
1673
|
-
*
|
|
1968
|
+
* special `mock` property, which is an instance of [`MockPropertyContext`][], and
|
|
1969
|
+
* can be used for inspecting and changing the behavior of the mocked property.
|
|
1674
1970
|
*/
|
|
1675
1971
|
property<
|
|
1676
1972
|
MockedObject extends object,
|
|
@@ -1850,7 +2146,7 @@ declare module "node:test" {
|
|
|
1850
2146
|
restore(): void;
|
|
1851
2147
|
}
|
|
1852
2148
|
/**
|
|
1853
|
-
* @since
|
|
2149
|
+
* @since v24.3.0
|
|
1854
2150
|
*/
|
|
1855
2151
|
class MockPropertyContext<PropertyType = any> {
|
|
1856
2152
|
/**
|
|
@@ -1888,6 +2184,8 @@ declare module "node:test" {
|
|
|
1888
2184
|
* test('changes a mock behavior once', (t) => {
|
|
1889
2185
|
* const obj = { foo: 1 };
|
|
1890
2186
|
*
|
|
2187
|
+
* const prop = t.mock.property(obj, 'foo', 5);
|
|
2188
|
+
*
|
|
1891
2189
|
* assert.strictEqual(obj.foo, 5);
|
|
1892
2190
|
* prop.mock.mockImplementationOnce(25);
|
|
1893
2191
|
* assert.strictEqual(obj.foo, 25);
|
|
@@ -1926,7 +2224,6 @@ declare module "node:test" {
|
|
|
1926
2224
|
* The `MockTracker` provides a top-level `timers` export
|
|
1927
2225
|
* which is a `MockTimers` instance.
|
|
1928
2226
|
* @since v20.4.0
|
|
1929
|
-
* @experimental
|
|
1930
2227
|
*/
|
|
1931
2228
|
interface MockTimers {
|
|
1932
2229
|
/**
|
|
@@ -1979,24 +2276,28 @@ declare module "node:test" {
|
|
|
1979
2276
|
*/
|
|
1980
2277
|
enable(options?: MockTimersOptions): void;
|
|
1981
2278
|
/**
|
|
1982
|
-
*
|
|
1983
|
-
*
|
|
1984
|
-
*
|
|
2279
|
+
* Sets the current Unix timestamp that will be used as reference for any mocked
|
|
2280
|
+
* `Date` objects.
|
|
2281
|
+
*
|
|
1985
2282
|
* ```js
|
|
1986
2283
|
* import assert from 'node:assert';
|
|
1987
2284
|
* import { test } from 'node:test';
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
*
|
|
1991
|
-
*
|
|
1992
|
-
* //
|
|
1993
|
-
*
|
|
1994
|
-
*
|
|
1995
|
-
*
|
|
2285
|
+
*
|
|
2286
|
+
* test('runAll functions following the given order', (context) => {
|
|
2287
|
+
* const now = Date.now();
|
|
2288
|
+
* const setTime = 1000;
|
|
2289
|
+
* // Date.now is not mocked
|
|
2290
|
+
* assert.deepStrictEqual(Date.now(), now);
|
|
2291
|
+
*
|
|
2292
|
+
* context.mock.timers.enable({ apis: ['Date'] });
|
|
2293
|
+
* context.mock.timers.setTime(setTime);
|
|
2294
|
+
* // Date.now is now 1000
|
|
2295
|
+
* assert.strictEqual(Date.now(), setTime);
|
|
1996
2296
|
* });
|
|
1997
2297
|
* ```
|
|
2298
|
+
* @since v21.2.0, v20.11.0
|
|
1998
2299
|
*/
|
|
1999
|
-
setTime(
|
|
2300
|
+
setTime(milliseconds: number): void;
|
|
2000
2301
|
/**
|
|
2001
2302
|
* This function restores the default behavior of all mocks that were previously
|
|
2002
2303
|
* created by this `MockTimers` instance and disassociates the mocks
|
|
@@ -2183,83 +2484,3 @@ declare module "node:test" {
|
|
|
2183
2484
|
}[keyof T];
|
|
2184
2485
|
export = test;
|
|
2185
2486
|
}
|
|
2186
|
-
|
|
2187
|
-
/**
|
|
2188
|
-
* The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
|
|
2189
|
-
* To access it:
|
|
2190
|
-
*
|
|
2191
|
-
* ```js
|
|
2192
|
-
* import test from 'node:test/reporters';
|
|
2193
|
-
* ```
|
|
2194
|
-
*
|
|
2195
|
-
* This module is only available under the `node:` scheme. The following will not
|
|
2196
|
-
* work:
|
|
2197
|
-
*
|
|
2198
|
-
* ```js
|
|
2199
|
-
* import test from 'node:test/reporters';
|
|
2200
|
-
* ```
|
|
2201
|
-
* @since v19.9.0
|
|
2202
|
-
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/test/reporters.js)
|
|
2203
|
-
*/
|
|
2204
|
-
declare module "node:test/reporters" {
|
|
2205
|
-
import { Transform, TransformOptions } from "node:stream";
|
|
2206
|
-
import { EventData } from "node:test";
|
|
2207
|
-
|
|
2208
|
-
type TestEvent =
|
|
2209
|
-
| { type: "test:coverage"; data: EventData.TestCoverage }
|
|
2210
|
-
| { type: "test:complete"; data: EventData.TestComplete }
|
|
2211
|
-
| { type: "test:dequeue"; data: EventData.TestDequeue }
|
|
2212
|
-
| { type: "test:diagnostic"; data: EventData.TestDiagnostic }
|
|
2213
|
-
| { type: "test:enqueue"; data: EventData.TestEnqueue }
|
|
2214
|
-
| { type: "test:fail"; data: EventData.TestFail }
|
|
2215
|
-
| { type: "test:pass"; data: EventData.TestPass }
|
|
2216
|
-
| { type: "test:plan"; data: EventData.TestPlan }
|
|
2217
|
-
| { type: "test:start"; data: EventData.TestStart }
|
|
2218
|
-
| { type: "test:stderr"; data: EventData.TestStderr }
|
|
2219
|
-
| { type: "test:stdout"; data: EventData.TestStdout }
|
|
2220
|
-
| { type: "test:summary"; data: EventData.TestSummary }
|
|
2221
|
-
| { type: "test:watch:drained"; data: undefined };
|
|
2222
|
-
type TestEventGenerator = AsyncGenerator<TestEvent, void>;
|
|
2223
|
-
|
|
2224
|
-
interface ReporterConstructorWrapper<T extends new(...args: any[]) => Transform> {
|
|
2225
|
-
new(...args: ConstructorParameters<T>): InstanceType<T>;
|
|
2226
|
-
(...args: ConstructorParameters<T>): InstanceType<T>;
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
/**
|
|
2230
|
-
* The `dot` reporter outputs the test results in a compact format,
|
|
2231
|
-
* where each passing test is represented by a `.`,
|
|
2232
|
-
* and each failing test is represented by a `X`.
|
|
2233
|
-
* @since v20.0.0
|
|
2234
|
-
*/
|
|
2235
|
-
function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
|
|
2236
|
-
/**
|
|
2237
|
-
* The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
|
|
2238
|
-
* @since v20.0.0
|
|
2239
|
-
*/
|
|
2240
|
-
function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
|
|
2241
|
-
class SpecReporter extends Transform {
|
|
2242
|
-
constructor();
|
|
2243
|
-
}
|
|
2244
|
-
/**
|
|
2245
|
-
* The `spec` reporter outputs the test results in a human-readable format.
|
|
2246
|
-
* @since v20.0.0
|
|
2247
|
-
*/
|
|
2248
|
-
const spec: ReporterConstructorWrapper<typeof SpecReporter>;
|
|
2249
|
-
/**
|
|
2250
|
-
* The `junit` reporter outputs test results in a jUnit XML format.
|
|
2251
|
-
* @since v21.0.0
|
|
2252
|
-
*/
|
|
2253
|
-
function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
|
|
2254
|
-
class LcovReporter extends Transform {
|
|
2255
|
-
constructor(opts?: Omit<TransformOptions, "writableObjectMode">);
|
|
2256
|
-
}
|
|
2257
|
-
/**
|
|
2258
|
-
* The `lcov` reporter outputs test coverage when used with the
|
|
2259
|
-
* [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--experimental-test-coverage) flag.
|
|
2260
|
-
* @since v22.0.0
|
|
2261
|
-
*/
|
|
2262
|
-
const lcov: LcovReporter;
|
|
2263
|
-
|
|
2264
|
-
export { dot, junit, lcov, spec, tap, TestEvent };
|
|
2265
|
-
}
|