@anthropic-ai/claude-code 0.2.27 → 0.2.30

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.
Files changed (415) hide show
  1. package/cli.mjs +418 -666
  2. package/package.json +1 -5
  3. package/vendor/sdk/CHANGELOG.md +0 -1421
  4. package/vendor/sdk/LICENSE +0 -8
  5. package/vendor/sdk/README.md +0 -536
  6. package/vendor/sdk/_shims/MultipartBody.d.ts +0 -9
  7. package/vendor/sdk/_shims/MultipartBody.d.ts.map +0 -1
  8. package/vendor/sdk/_shims/MultipartBody.js +0 -16
  9. package/vendor/sdk/_shims/MultipartBody.js.map +0 -1
  10. package/vendor/sdk/_shims/MultipartBody.mjs +0 -12
  11. package/vendor/sdk/_shims/MultipartBody.mjs.map +0 -1
  12. package/vendor/sdk/_shims/README.md +0 -46
  13. package/vendor/sdk/_shims/auto/runtime-bun.d.ts +0 -5
  14. package/vendor/sdk/_shims/auto/runtime-bun.d.ts.map +0 -1
  15. package/vendor/sdk/_shims/auto/runtime-bun.js +0 -21
  16. package/vendor/sdk/_shims/auto/runtime-bun.js.map +0 -1
  17. package/vendor/sdk/_shims/auto/runtime-bun.mjs +0 -2
  18. package/vendor/sdk/_shims/auto/runtime-bun.mjs.map +0 -1
  19. package/vendor/sdk/_shims/auto/runtime-node.d.ts +0 -5
  20. package/vendor/sdk/_shims/auto/runtime-node.d.ts.map +0 -1
  21. package/vendor/sdk/_shims/auto/runtime-node.js +0 -21
  22. package/vendor/sdk/_shims/auto/runtime-node.js.map +0 -1
  23. package/vendor/sdk/_shims/auto/runtime-node.mjs +0 -2
  24. package/vendor/sdk/_shims/auto/runtime-node.mjs.map +0 -1
  25. package/vendor/sdk/_shims/auto/runtime.d.ts +0 -5
  26. package/vendor/sdk/_shims/auto/runtime.d.ts.map +0 -1
  27. package/vendor/sdk/_shims/auto/runtime.js +0 -21
  28. package/vendor/sdk/_shims/auto/runtime.js.map +0 -1
  29. package/vendor/sdk/_shims/auto/runtime.mjs +0 -2
  30. package/vendor/sdk/_shims/auto/runtime.mjs.map +0 -1
  31. package/vendor/sdk/_shims/auto/types-node.d.ts +0 -5
  32. package/vendor/sdk/_shims/auto/types-node.d.ts.map +0 -1
  33. package/vendor/sdk/_shims/auto/types-node.js +0 -21
  34. package/vendor/sdk/_shims/auto/types-node.js.map +0 -1
  35. package/vendor/sdk/_shims/auto/types-node.mjs +0 -2
  36. package/vendor/sdk/_shims/auto/types-node.mjs.map +0 -1
  37. package/vendor/sdk/_shims/auto/types.d.ts +0 -101
  38. package/vendor/sdk/_shims/auto/types.js +0 -3
  39. package/vendor/sdk/_shims/auto/types.mjs +0 -3
  40. package/vendor/sdk/_shims/bun-runtime.d.ts +0 -6
  41. package/vendor/sdk/_shims/bun-runtime.d.ts.map +0 -1
  42. package/vendor/sdk/_shims/bun-runtime.js +0 -14
  43. package/vendor/sdk/_shims/bun-runtime.js.map +0 -1
  44. package/vendor/sdk/_shims/bun-runtime.mjs +0 -10
  45. package/vendor/sdk/_shims/bun-runtime.mjs.map +0 -1
  46. package/vendor/sdk/_shims/index.d.ts +0 -81
  47. package/vendor/sdk/_shims/index.js +0 -13
  48. package/vendor/sdk/_shims/index.mjs +0 -7
  49. package/vendor/sdk/_shims/manual-types.d.ts +0 -12
  50. package/vendor/sdk/_shims/manual-types.js +0 -3
  51. package/vendor/sdk/_shims/manual-types.mjs +0 -3
  52. package/vendor/sdk/_shims/node-runtime.d.ts +0 -3
  53. package/vendor/sdk/_shims/node-runtime.d.ts.map +0 -1
  54. package/vendor/sdk/_shims/node-runtime.js +0 -89
  55. package/vendor/sdk/_shims/node-runtime.js.map +0 -1
  56. package/vendor/sdk/_shims/node-runtime.mjs +0 -56
  57. package/vendor/sdk/_shims/node-runtime.mjs.map +0 -1
  58. package/vendor/sdk/_shims/node-types.d.ts +0 -42
  59. package/vendor/sdk/_shims/node-types.js +0 -3
  60. package/vendor/sdk/_shims/node-types.mjs +0 -3
  61. package/vendor/sdk/_shims/registry.d.ts +0 -37
  62. package/vendor/sdk/_shims/registry.d.ts.map +0 -1
  63. package/vendor/sdk/_shims/registry.js +0 -41
  64. package/vendor/sdk/_shims/registry.js.map +0 -1
  65. package/vendor/sdk/_shims/registry.mjs +0 -37
  66. package/vendor/sdk/_shims/registry.mjs.map +0 -1
  67. package/vendor/sdk/_shims/web-runtime.d.ts +0 -5
  68. package/vendor/sdk/_shims/web-runtime.d.ts.map +0 -1
  69. package/vendor/sdk/_shims/web-runtime.js +0 -78
  70. package/vendor/sdk/_shims/web-runtime.js.map +0 -1
  71. package/vendor/sdk/_shims/web-runtime.mjs +0 -71
  72. package/vendor/sdk/_shims/web-runtime.mjs.map +0 -1
  73. package/vendor/sdk/_shims/web-types.d.ts +0 -83
  74. package/vendor/sdk/_shims/web-types.js +0 -3
  75. package/vendor/sdk/_shims/web-types.mjs +0 -3
  76. package/vendor/sdk/_vendor/partial-json-parser/parser.d.ts +0 -3
  77. package/vendor/sdk/_vendor/partial-json-parser/parser.d.ts.map +0 -1
  78. package/vendor/sdk/_vendor/partial-json-parser/parser.js +0 -226
  79. package/vendor/sdk/_vendor/partial-json-parser/parser.js.map +0 -1
  80. package/vendor/sdk/_vendor/partial-json-parser/parser.mjs +0 -223
  81. package/vendor/sdk/_vendor/partial-json-parser/parser.mjs.map +0 -1
  82. package/vendor/sdk/core.d.ts +0 -248
  83. package/vendor/sdk/core.d.ts.map +0 -1
  84. package/vendor/sdk/core.js +0 -935
  85. package/vendor/sdk/core.js.map +0 -1
  86. package/vendor/sdk/core.mjs +0 -903
  87. package/vendor/sdk/core.mjs.map +0 -1
  88. package/vendor/sdk/error.d.ts +0 -48
  89. package/vendor/sdk/error.d.ts.map +0 -1
  90. package/vendor/sdk/error.js +0 -114
  91. package/vendor/sdk/error.js.map +0 -1
  92. package/vendor/sdk/error.mjs +0 -98
  93. package/vendor/sdk/error.mjs.map +0 -1
  94. package/vendor/sdk/index.d.mts +0 -152
  95. package/vendor/sdk/index.d.ts +0 -152
  96. package/vendor/sdk/index.d.ts.map +0 -1
  97. package/vendor/sdk/index.js +0 -179
  98. package/vendor/sdk/index.js.map +0 -1
  99. package/vendor/sdk/index.mjs +0 -136
  100. package/vendor/sdk/index.mjs.map +0 -1
  101. package/vendor/sdk/internal/decoders/jsonl.d.ts +0 -12
  102. package/vendor/sdk/internal/decoders/jsonl.d.ts.map +0 -1
  103. package/vendor/sdk/internal/decoders/jsonl.js +0 -35
  104. package/vendor/sdk/internal/decoders/jsonl.js.map +0 -1
  105. package/vendor/sdk/internal/decoders/jsonl.mjs +0 -31
  106. package/vendor/sdk/internal/decoders/jsonl.mjs.map +0 -1
  107. package/vendor/sdk/internal/decoders/line.d.ts +0 -20
  108. package/vendor/sdk/internal/decoders/line.d.ts.map +0 -1
  109. package/vendor/sdk/internal/decoders/line.js +0 -123
  110. package/vendor/sdk/internal/decoders/line.js.map +0 -1
  111. package/vendor/sdk/internal/decoders/line.mjs +0 -119
  112. package/vendor/sdk/internal/decoders/line.mjs.map +0 -1
  113. package/vendor/sdk/internal/stream-utils.d.ts +0 -8
  114. package/vendor/sdk/internal/stream-utils.d.ts.map +0 -1
  115. package/vendor/sdk/internal/stream-utils.js +0 -39
  116. package/vendor/sdk/internal/stream-utils.js.map +0 -1
  117. package/vendor/sdk/internal/stream-utils.mjs +0 -35
  118. package/vendor/sdk/internal/stream-utils.mjs.map +0 -1
  119. package/vendor/sdk/lib/BetaMessageStream.d.ts +0 -114
  120. package/vendor/sdk/lib/BetaMessageStream.d.ts.map +0 -1
  121. package/vendor/sdk/lib/BetaMessageStream.js +0 -547
  122. package/vendor/sdk/lib/BetaMessageStream.js.map +0 -1
  123. package/vendor/sdk/lib/BetaMessageStream.mjs +0 -543
  124. package/vendor/sdk/lib/BetaMessageStream.mjs.map +0 -1
  125. package/vendor/sdk/lib/MessageStream.d.ts +0 -114
  126. package/vendor/sdk/lib/MessageStream.d.ts.map +0 -1
  127. package/vendor/sdk/lib/MessageStream.js +0 -547
  128. package/vendor/sdk/lib/MessageStream.js.map +0 -1
  129. package/vendor/sdk/lib/MessageStream.mjs +0 -543
  130. package/vendor/sdk/lib/MessageStream.mjs.map +0 -1
  131. package/vendor/sdk/node_modules/@types/node/LICENSE +0 -21
  132. package/vendor/sdk/node_modules/@types/node/README.md +0 -15
  133. package/vendor/sdk/node_modules/@types/node/assert/strict.d.ts +0 -8
  134. package/vendor/sdk/node_modules/@types/node/assert.d.ts +0 -985
  135. package/vendor/sdk/node_modules/@types/node/async_hooks.d.ts +0 -522
  136. package/vendor/sdk/node_modules/@types/node/buffer.buffer.d.ts +0 -385
  137. package/vendor/sdk/node_modules/@types/node/buffer.d.ts +0 -1903
  138. package/vendor/sdk/node_modules/@types/node/child_process.d.ts +0 -1549
  139. package/vendor/sdk/node_modules/@types/node/cluster.d.ts +0 -578
  140. package/vendor/sdk/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  141. package/vendor/sdk/node_modules/@types/node/compatibility/index.d.ts +0 -9
  142. package/vendor/sdk/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  143. package/vendor/sdk/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  144. package/vendor/sdk/node_modules/@types/node/console.d.ts +0 -452
  145. package/vendor/sdk/node_modules/@types/node/constants.d.ts +0 -19
  146. package/vendor/sdk/node_modules/@types/node/crypto.d.ts +0 -4453
  147. package/vendor/sdk/node_modules/@types/node/dgram.d.ts +0 -596
  148. package/vendor/sdk/node_modules/@types/node/diagnostics_channel.d.ts +0 -546
  149. package/vendor/sdk/node_modules/@types/node/dns/promises.d.ts +0 -475
  150. package/vendor/sdk/node_modules/@types/node/dns.d.ts +0 -853
  151. package/vendor/sdk/node_modules/@types/node/dom-events.d.ts +0 -124
  152. package/vendor/sdk/node_modules/@types/node/domain.d.ts +0 -170
  153. package/vendor/sdk/node_modules/@types/node/events.d.ts +0 -819
  154. package/vendor/sdk/node_modules/@types/node/fs/promises.d.ts +0 -1205
  155. package/vendor/sdk/node_modules/@types/node/fs.d.ts +0 -4237
  156. package/vendor/sdk/node_modules/@types/node/globals.d.ts +0 -442
  157. package/vendor/sdk/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  158. package/vendor/sdk/node_modules/@types/node/http.d.ts +0 -1839
  159. package/vendor/sdk/node_modules/@types/node/http2.d.ts +0 -2517
  160. package/vendor/sdk/node_modules/@types/node/https.d.ts +0 -544
  161. package/vendor/sdk/node_modules/@types/node/index.d.ts +0 -90
  162. package/vendor/sdk/node_modules/@types/node/inspector.d.ts +0 -2775
  163. package/vendor/sdk/node_modules/@types/node/module.d.ts +0 -291
  164. package/vendor/sdk/node_modules/@types/node/net.d.ts +0 -924
  165. package/vendor/sdk/node_modules/@types/node/os.d.ts +0 -473
  166. package/vendor/sdk/node_modules/@types/node/package.json +0 -225
  167. package/vendor/sdk/node_modules/@types/node/path.d.ts +0 -191
  168. package/vendor/sdk/node_modules/@types/node/perf_hooks.d.ts +0 -753
  169. package/vendor/sdk/node_modules/@types/node/process.d.ts +0 -1553
  170. package/vendor/sdk/node_modules/@types/node/punycode.d.ts +0 -117
  171. package/vendor/sdk/node_modules/@types/node/querystring.d.ts +0 -141
  172. package/vendor/sdk/node_modules/@types/node/readline/promises.d.ts +0 -154
  173. package/vendor/sdk/node_modules/@types/node/readline.d.ts +0 -715
  174. package/vendor/sdk/node_modules/@types/node/repl.d.ts +0 -430
  175. package/vendor/sdk/node_modules/@types/node/stream/consumers.d.ts +0 -12
  176. package/vendor/sdk/node_modules/@types/node/stream/promises.d.ts +0 -90
  177. package/vendor/sdk/node_modules/@types/node/stream/web.d.ts +0 -523
  178. package/vendor/sdk/node_modules/@types/node/stream.d.ts +0 -1731
  179. package/vendor/sdk/node_modules/@types/node/string_decoder.d.ts +0 -67
  180. package/vendor/sdk/node_modules/@types/node/test.d.ts +0 -1245
  181. package/vendor/sdk/node_modules/@types/node/timers/promises.d.ts +0 -93
  182. package/vendor/sdk/node_modules/@types/node/timers.d.ts +0 -126
  183. package/vendor/sdk/node_modules/@types/node/tls.d.ts +0 -1203
  184. package/vendor/sdk/node_modules/@types/node/trace_events.d.ts +0 -171
  185. package/vendor/sdk/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -385
  186. package/vendor/sdk/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  187. package/vendor/sdk/node_modules/@types/node/ts5.6/index.d.ts +0 -90
  188. package/vendor/sdk/node_modules/@types/node/tty.d.ts +0 -206
  189. package/vendor/sdk/node_modules/@types/node/url.d.ts +0 -957
  190. package/vendor/sdk/node_modules/@types/node/util.d.ts +0 -2083
  191. package/vendor/sdk/node_modules/@types/node/v8.d.ts +0 -753
  192. package/vendor/sdk/node_modules/@types/node/vm.d.ts +0 -666
  193. package/vendor/sdk/node_modules/@types/node/wasi.d.ts +0 -160
  194. package/vendor/sdk/node_modules/@types/node/worker_threads.d.ts +0 -695
  195. package/vendor/sdk/node_modules/@types/node/zlib.d.ts +0 -517
  196. package/vendor/sdk/node_modules/undici-types/README.md +0 -6
  197. package/vendor/sdk/node_modules/undici-types/agent.d.ts +0 -31
  198. package/vendor/sdk/node_modules/undici-types/api.d.ts +0 -43
  199. package/vendor/sdk/node_modules/undici-types/balanced-pool.d.ts +0 -18
  200. package/vendor/sdk/node_modules/undici-types/cache.d.ts +0 -36
  201. package/vendor/sdk/node_modules/undici-types/client.d.ts +0 -97
  202. package/vendor/sdk/node_modules/undici-types/connector.d.ts +0 -34
  203. package/vendor/sdk/node_modules/undici-types/content-type.d.ts +0 -21
  204. package/vendor/sdk/node_modules/undici-types/cookies.d.ts +0 -28
  205. package/vendor/sdk/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  206. package/vendor/sdk/node_modules/undici-types/dispatcher.d.ts +0 -241
  207. package/vendor/sdk/node_modules/undici-types/errors.d.ts +0 -128
  208. package/vendor/sdk/node_modules/undici-types/fetch.d.ts +0 -209
  209. package/vendor/sdk/node_modules/undici-types/file.d.ts +0 -39
  210. package/vendor/sdk/node_modules/undici-types/filereader.d.ts +0 -54
  211. package/vendor/sdk/node_modules/undici-types/formdata.d.ts +0 -108
  212. package/vendor/sdk/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  213. package/vendor/sdk/node_modules/undici-types/global-origin.d.ts +0 -7
  214. package/vendor/sdk/node_modules/undici-types/handlers.d.ts +0 -9
  215. package/vendor/sdk/node_modules/undici-types/header.d.ts +0 -4
  216. package/vendor/sdk/node_modules/undici-types/index.d.ts +0 -63
  217. package/vendor/sdk/node_modules/undici-types/interceptors.d.ts +0 -5
  218. package/vendor/sdk/node_modules/undici-types/mock-agent.d.ts +0 -50
  219. package/vendor/sdk/node_modules/undici-types/mock-client.d.ts +0 -25
  220. package/vendor/sdk/node_modules/undici-types/mock-errors.d.ts +0 -12
  221. package/vendor/sdk/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  222. package/vendor/sdk/node_modules/undici-types/mock-pool.d.ts +0 -25
  223. package/vendor/sdk/node_modules/undici-types/package.json +0 -55
  224. package/vendor/sdk/node_modules/undici-types/patch.d.ts +0 -71
  225. package/vendor/sdk/node_modules/undici-types/pool-stats.d.ts +0 -19
  226. package/vendor/sdk/node_modules/undici-types/pool.d.ts +0 -28
  227. package/vendor/sdk/node_modules/undici-types/proxy-agent.d.ts +0 -30
  228. package/vendor/sdk/node_modules/undici-types/readable.d.ts +0 -61
  229. package/vendor/sdk/node_modules/undici-types/webidl.d.ts +0 -220
  230. package/vendor/sdk/node_modules/undici-types/websocket.d.ts +0 -131
  231. package/vendor/sdk/package.json +0 -124
  232. package/vendor/sdk/pagination.d.ts +0 -27
  233. package/vendor/sdk/pagination.d.ts.map +0 -1
  234. package/vendor/sdk/pagination.js +0 -60
  235. package/vendor/sdk/pagination.js.map +0 -1
  236. package/vendor/sdk/pagination.mjs +0 -56
  237. package/vendor/sdk/pagination.mjs.map +0 -1
  238. package/vendor/sdk/resource.d.ts +0 -6
  239. package/vendor/sdk/resource.d.ts.map +0 -1
  240. package/vendor/sdk/resource.js +0 -11
  241. package/vendor/sdk/resource.js.map +0 -1
  242. package/vendor/sdk/resource.mjs +0 -7
  243. package/vendor/sdk/resource.mjs.map +0 -1
  244. package/vendor/sdk/resources/beta/beta.d.ts +0 -57
  245. package/vendor/sdk/resources/beta/beta.d.ts.map +0 -1
  246. package/vendor/sdk/resources/beta/beta.js +0 -44
  247. package/vendor/sdk/resources/beta/beta.js.map +0 -1
  248. package/vendor/sdk/resources/beta/beta.mjs +0 -17
  249. package/vendor/sdk/resources/beta/beta.mjs.map +0 -1
  250. package/vendor/sdk/resources/beta/index.d.ts +0 -4
  251. package/vendor/sdk/resources/beta/index.d.ts.map +0 -1
  252. package/vendor/sdk/resources/beta/index.js +0 -12
  253. package/vendor/sdk/resources/beta/index.js.map +0 -1
  254. package/vendor/sdk/resources/beta/index.mjs +0 -5
  255. package/vendor/sdk/resources/beta/index.mjs.map +0 -1
  256. package/vendor/sdk/resources/beta/messages/batches.d.ts +0 -289
  257. package/vendor/sdk/resources/beta/messages/batches.d.ts.map +0 -1
  258. package/vendor/sdk/resources/beta/messages/batches.js +0 -112
  259. package/vendor/sdk/resources/beta/messages/batches.js.map +0 -1
  260. package/vendor/sdk/resources/beta/messages/batches.mjs +0 -107
  261. package/vendor/sdk/resources/beta/messages/batches.mjs.map +0 -1
  262. package/vendor/sdk/resources/beta/messages/index.d.ts +0 -3
  263. package/vendor/sdk/resources/beta/messages/index.d.ts.map +0 -1
  264. package/vendor/sdk/resources/beta/messages/index.js +0 -10
  265. package/vendor/sdk/resources/beta/messages/index.js.map +0 -1
  266. package/vendor/sdk/resources/beta/messages/index.mjs +0 -4
  267. package/vendor/sdk/resources/beta/messages/index.mjs.map +0 -1
  268. package/vendor/sdk/resources/beta/messages/messages.d.ts +0 -1038
  269. package/vendor/sdk/resources/beta/messages/messages.d.ts.map +0 -1
  270. package/vendor/sdk/resources/beta/messages/messages.js +0 -93
  271. package/vendor/sdk/resources/beta/messages/messages.js.map +0 -1
  272. package/vendor/sdk/resources/beta/messages/messages.mjs +0 -66
  273. package/vendor/sdk/resources/beta/messages/messages.mjs.map +0 -1
  274. package/vendor/sdk/resources/beta/models.d.ts +0 -49
  275. package/vendor/sdk/resources/beta/models.d.ts.map +0 -1
  276. package/vendor/sdk/resources/beta/models.js +0 -30
  277. package/vendor/sdk/resources/beta/models.js.map +0 -1
  278. package/vendor/sdk/resources/beta/models.mjs +0 -25
  279. package/vendor/sdk/resources/beta/models.mjs.map +0 -1
  280. package/vendor/sdk/resources/completions.d.ts +0 -166
  281. package/vendor/sdk/resources/completions.d.ts.map +0 -1
  282. package/vendor/sdk/resources/completions.js +0 -17
  283. package/vendor/sdk/resources/completions.js.map +0 -1
  284. package/vendor/sdk/resources/completions.mjs +0 -13
  285. package/vendor/sdk/resources/completions.mjs.map +0 -1
  286. package/vendor/sdk/resources/index.d.ts +0 -6
  287. package/vendor/sdk/resources/index.d.ts.map +0 -1
  288. package/vendor/sdk/resources/index.js +0 -29
  289. package/vendor/sdk/resources/index.js.map +0 -1
  290. package/vendor/sdk/resources/index.mjs +0 -7
  291. package/vendor/sdk/resources/index.mjs.map +0 -1
  292. package/vendor/sdk/resources/messages/batches.d.ts +0 -253
  293. package/vendor/sdk/resources/messages/batches.d.ts.map +0 -1
  294. package/vendor/sdk/resources/messages/batches.js +0 -102
  295. package/vendor/sdk/resources/messages/batches.js.map +0 -1
  296. package/vendor/sdk/resources/messages/batches.mjs +0 -97
  297. package/vendor/sdk/resources/messages/batches.mjs.map +0 -1
  298. package/vendor/sdk/resources/messages/index.d.ts +0 -3
  299. package/vendor/sdk/resources/messages/index.d.ts.map +0 -1
  300. package/vendor/sdk/resources/messages/index.js +0 -10
  301. package/vendor/sdk/resources/messages/index.js.map +0 -1
  302. package/vendor/sdk/resources/messages/index.mjs +0 -4
  303. package/vendor/sdk/resources/messages/index.mjs.map +0 -1
  304. package/vendor/sdk/resources/messages/messages.d.ts +0 -1028
  305. package/vendor/sdk/resources/messages/messages.d.ts.map +0 -1
  306. package/vendor/sdk/resources/messages/messages.js +0 -82
  307. package/vendor/sdk/resources/messages/messages.js.map +0 -1
  308. package/vendor/sdk/resources/messages/messages.mjs +0 -54
  309. package/vendor/sdk/resources/messages/messages.mjs.map +0 -1
  310. package/vendor/sdk/resources/models.d.ts +0 -49
  311. package/vendor/sdk/resources/models.d.ts.map +0 -1
  312. package/vendor/sdk/resources/models.js +0 -30
  313. package/vendor/sdk/resources/models.js.map +0 -1
  314. package/vendor/sdk/resources/models.mjs +0 -25
  315. package/vendor/sdk/resources/models.mjs.map +0 -1
  316. package/vendor/sdk/resources/shared.d.ts +0 -42
  317. package/vendor/sdk/resources/shared.d.ts.map +0 -1
  318. package/vendor/sdk/resources/shared.js +0 -4
  319. package/vendor/sdk/resources/shared.js.map +0 -1
  320. package/vendor/sdk/resources/shared.mjs +0 -3
  321. package/vendor/sdk/resources/shared.mjs.map +0 -1
  322. package/vendor/sdk/resources/top-level.d.ts +0 -2
  323. package/vendor/sdk/resources/top-level.d.ts.map +0 -1
  324. package/vendor/sdk/resources/top-level.js +0 -4
  325. package/vendor/sdk/resources/top-level.js.map +0 -1
  326. package/vendor/sdk/resources/top-level.mjs +0 -3
  327. package/vendor/sdk/resources/top-level.mjs.map +0 -1
  328. package/vendor/sdk/shims/node.d.ts +0 -30
  329. package/vendor/sdk/shims/node.d.ts.map +0 -1
  330. package/vendor/sdk/shims/node.js +0 -31
  331. package/vendor/sdk/shims/node.js.map +0 -1
  332. package/vendor/sdk/shims/node.mjs +0 -5
  333. package/vendor/sdk/shims/node.mjs.map +0 -1
  334. package/vendor/sdk/shims/web.d.ts +0 -26
  335. package/vendor/sdk/shims/web.d.ts.map +0 -1
  336. package/vendor/sdk/shims/web.js +0 -31
  337. package/vendor/sdk/shims/web.js.map +0 -1
  338. package/vendor/sdk/shims/web.mjs +0 -5
  339. package/vendor/sdk/shims/web.mjs.map +0 -1
  340. package/vendor/sdk/src/_shims/MultipartBody.ts +0 -9
  341. package/vendor/sdk/src/_shims/README.md +0 -46
  342. package/vendor/sdk/src/_shims/auto/runtime-bun.ts +0 -4
  343. package/vendor/sdk/src/_shims/auto/runtime-node.ts +0 -4
  344. package/vendor/sdk/src/_shims/auto/runtime.ts +0 -4
  345. package/vendor/sdk/src/_shims/auto/types-node.ts +0 -4
  346. package/vendor/sdk/src/_shims/auto/types.d.ts +0 -101
  347. package/vendor/sdk/src/_shims/auto/types.js +0 -3
  348. package/vendor/sdk/src/_shims/auto/types.mjs +0 -3
  349. package/vendor/sdk/src/_shims/bun-runtime.ts +0 -14
  350. package/vendor/sdk/src/_shims/index.d.ts +0 -81
  351. package/vendor/sdk/src/_shims/index.js +0 -13
  352. package/vendor/sdk/src/_shims/index.mjs +0 -7
  353. package/vendor/sdk/src/_shims/manual-types.d.ts +0 -12
  354. package/vendor/sdk/src/_shims/manual-types.js +0 -3
  355. package/vendor/sdk/src/_shims/manual-types.mjs +0 -3
  356. package/vendor/sdk/src/_shims/node-runtime.ts +0 -81
  357. package/vendor/sdk/src/_shims/node-types.d.ts +0 -42
  358. package/vendor/sdk/src/_shims/node-types.js +0 -3
  359. package/vendor/sdk/src/_shims/node-types.mjs +0 -3
  360. package/vendor/sdk/src/_shims/registry.ts +0 -67
  361. package/vendor/sdk/src/_shims/web-runtime.ts +0 -103
  362. package/vendor/sdk/src/_shims/web-types.d.ts +0 -83
  363. package/vendor/sdk/src/_shims/web-types.js +0 -3
  364. package/vendor/sdk/src/_shims/web-types.mjs +0 -3
  365. package/vendor/sdk/src/_vendor/partial-json-parser/README.md +0 -3
  366. package/vendor/sdk/src/_vendor/partial-json-parser/parser.ts +0 -264
  367. package/vendor/sdk/src/core.ts +0 -1250
  368. package/vendor/sdk/src/error.ts +0 -133
  369. package/vendor/sdk/src/index.ts +0 -465
  370. package/vendor/sdk/src/internal/decoders/jsonl.ts +0 -41
  371. package/vendor/sdk/src/internal/decoders/line.ts +0 -145
  372. package/vendor/sdk/src/internal/stream-utils.ts +0 -32
  373. package/vendor/sdk/src/lib/.keep +0 -4
  374. package/vendor/sdk/src/lib/BetaMessageStream.ts +0 -661
  375. package/vendor/sdk/src/lib/MessageStream.ts +0 -662
  376. package/vendor/sdk/src/pagination.ts +0 -92
  377. package/vendor/sdk/src/resource.ts +0 -11
  378. package/vendor/sdk/src/resources/beta/beta.ts +0 -249
  379. package/vendor/sdk/src/resources/beta/index.ts +0 -83
  380. package/vendor/sdk/src/resources/beta/messages/batches.ts +0 -486
  381. package/vendor/sdk/src/resources/beta/messages/index.ts +0 -87
  382. package/vendor/sdk/src/resources/beta/messages/messages.ts +0 -1444
  383. package/vendor/sdk/src/resources/beta/models.ts +0 -78
  384. package/vendor/sdk/src/resources/completions.ts +0 -210
  385. package/vendor/sdk/src/resources/index.ts +0 -95
  386. package/vendor/sdk/src/resources/messages/batches.ts +0 -352
  387. package/vendor/sdk/src/resources/messages/index.ts +0 -85
  388. package/vendor/sdk/src/resources/messages/messages.ts +0 -1412
  389. package/vendor/sdk/src/resources/models.ts +0 -75
  390. package/vendor/sdk/src/resources/shared.ts +0 -72
  391. package/vendor/sdk/src/resources/top-level.ts +0 -3
  392. package/vendor/sdk/src/shims/node.ts +0 -50
  393. package/vendor/sdk/src/shims/web.ts +0 -50
  394. package/vendor/sdk/src/streaming.ts +0 -372
  395. package/vendor/sdk/src/tsconfig.json +0 -11
  396. package/vendor/sdk/src/uploads.ts +0 -255
  397. package/vendor/sdk/src/version.ts +0 -1
  398. package/vendor/sdk/streaming.d.ts +0 -36
  399. package/vendor/sdk/streaming.d.ts.map +0 -1
  400. package/vendor/sdk/streaming.js +0 -316
  401. package/vendor/sdk/streaming.js.map +0 -1
  402. package/vendor/sdk/streaming.mjs +0 -310
  403. package/vendor/sdk/streaming.mjs.map +0 -1
  404. package/vendor/sdk/uploads.d.ts +0 -75
  405. package/vendor/sdk/uploads.d.ts.map +0 -1
  406. package/vendor/sdk/uploads.js +0 -171
  407. package/vendor/sdk/uploads.js.map +0 -1
  408. package/vendor/sdk/uploads.mjs +0 -158
  409. package/vendor/sdk/uploads.mjs.map +0 -1
  410. package/vendor/sdk/version.d.ts +0 -2
  411. package/vendor/sdk/version.d.ts.map +0 -1
  412. package/vendor/sdk/version.js +0 -5
  413. package/vendor/sdk/version.js.map +0 -1
  414. package/vendor/sdk/version.mjs +0 -2
  415. package/vendor/sdk/version.mjs.map +0 -1
@@ -1,1245 +0,0 @@
1
- /**
2
- * The `node:test` module provides a standalone testing module.
3
- * @see [source](https://github.com/nodejs/node/blob/v18.x/lib/test.js)
4
- */
5
- declare module "node:test" {
6
- /**
7
- * Programmatically start the test runner.
8
- * @since v18.9.0
9
- * @param options Configuration options for running tests.
10
- * @returns A {@link TestsStream} that emits events about the test execution.
11
- */
12
- function run(options?: RunOptions): TestsStream;
13
- /**
14
- * The `test()` function is the value imported from the test module. Each invocation of this
15
- * function results in reporting the test to the {@link TestsStream}.
16
- *
17
- * The {@link TestContext} object passed to the fn argument can be used to perform actions
18
- * related to the current test. Examples include skipping the test, adding additional
19
- * diagnostic information, or creating subtests.
20
- *
21
- * `test()` returns a {@link Promise} that resolves once the test completes. The return value
22
- * can usually be discarded for top level tests. However, the return value from subtests should
23
- * be used to prevent the parent test from finishing first and cancelling the subtest as shown
24
- * in the following example.
25
- *
26
- * ```js
27
- * test('top level test', async (t) => {
28
- * // The setTimeout() in the following subtest would cause it to outlive its
29
- * // parent test if 'await' is removed on the next line. Once the parent test
30
- * // completes, it will cancel any outstanding subtests.
31
- * await t.test('longer running subtest', async (t) => {
32
- * return new Promise((resolve, reject) => {
33
- * setTimeout(resolve, 1000);
34
- * });
35
- * });
36
- * });
37
- * ```
38
- * @since v18.0.0
39
- * @param name The name of the test, which is displayed when reporting test results.
40
- * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
41
- * @param options Configuration options for the test
42
- * @param fn The function under test. The first argument to this function is a
43
- * {@link TestContext} object. If the test uses callbacks, the callback function is
44
- * passed as the second argument. Default: A no-op function.
45
- * @returns A {@link Promise} resolved with `undefined` once the test completes.
46
- */
47
- function test(name?: string, fn?: TestFn): Promise<void>;
48
- function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
49
- function test(options?: TestOptions, fn?: TestFn): Promise<void>;
50
- function test(fn?: TestFn): Promise<void>;
51
- namespace test {
52
- export { after, afterEach, before, beforeEach, describe, it, mock, only, run, skip, test, todo };
53
- }
54
- /**
55
- * @since v18.6.0
56
- * @param name The name of the suite, which is displayed when reporting suite results.
57
- * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
58
- * @param options Configuration options for the suite
59
- * @param fn The function under suite. Default: A no-op function.
60
- */
61
- function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
62
- function describe(name?: string, fn?: SuiteFn): Promise<void>;
63
- function describe(options?: TestOptions, fn?: SuiteFn): Promise<void>;
64
- function describe(fn?: SuiteFn): Promise<void>;
65
- namespace describe {
66
- /**
67
- * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`.
68
- */
69
- function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
70
- function skip(name?: string, fn?: SuiteFn): Promise<void>;
71
- function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
72
- function skip(fn?: SuiteFn): Promise<void>;
73
- /**
74
- * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`.
75
- */
76
- function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
77
- function todo(name?: string, fn?: SuiteFn): Promise<void>;
78
- function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
79
- function todo(fn?: SuiteFn): Promise<void>;
80
- /**
81
- * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
82
- * @since v18.15.0
83
- */
84
- function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
85
- function only(name?: string, fn?: SuiteFn): Promise<void>;
86
- function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
87
- function only(fn?: SuiteFn): Promise<void>;
88
- }
89
-
90
- /**
91
- * @since v18.6.0
92
- * @param name The name of the test, which is displayed when reporting test results.
93
- * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
94
- * @param options Configuration options for the test
95
- * @param fn The function under test. If the test uses callbacks, the callback function is
96
- * passed as the second argument. Default: A no-op function.
97
- */
98
- function it(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
99
- function it(name?: string, fn?: TestFn): Promise<void>;
100
- function it(options?: TestOptions, fn?: TestFn): Promise<void>;
101
- function it(fn?: TestFn): Promise<void>;
102
- namespace it {
103
- /**
104
- * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
105
- */
106
- function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
107
- function skip(name?: string, fn?: TestFn): Promise<void>;
108
- function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
109
- function skip(fn?: TestFn): Promise<void>;
110
- /**
111
- * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
112
- */
113
- function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
114
- function todo(name?: string, fn?: TestFn): Promise<void>;
115
- function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
116
- function todo(fn?: TestFn): Promise<void>;
117
- /**
118
- * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.
119
- * @since v18.15.0
120
- */
121
- function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
122
- function only(name?: string, fn?: TestFn): Promise<void>;
123
- function only(options?: TestOptions, fn?: TestFn): Promise<void>;
124
- function only(fn?: TestFn): Promise<void>;
125
- }
126
- /**
127
- * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
128
- * @since v18.17.0
129
- */
130
- function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
131
- function skip(name?: string, fn?: TestFn): Promise<void>;
132
- function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
133
- function skip(fn?: TestFn): Promise<void>;
134
- /**
135
- * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
136
- * @since v18.17.0
137
- */
138
- function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
139
- function todo(name?: string, fn?: TestFn): Promise<void>;
140
- function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
141
- function todo(fn?: TestFn): Promise<void>;
142
- /**
143
- * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
144
- * @since v18.17.0
145
- */
146
- function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
147
- function only(name?: string, fn?: TestFn): Promise<void>;
148
- function only(options?: TestOptions, fn?: TestFn): Promise<void>;
149
- function only(fn?: TestFn): Promise<void>;
150
- /**
151
- * The type of a function under test. The first argument to this function is a
152
- * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
153
- * the second argument.
154
- */
155
- type TestFn = (t: TestContext, done: (result?: any) => void) => any;
156
- /**
157
- * The type of a function under Suite.
158
- */
159
- type SuiteFn = (s: SuiteContext) => void | Promise<void>;
160
- interface TestShard {
161
- /**
162
- * A positive integer between 1 and `<total>` that specifies the index of the shard to run.
163
- */
164
- index: number;
165
- /**
166
- * A positive integer that specifies the total number of shards to split the test files to.
167
- */
168
- total: number;
169
- }
170
- interface RunOptions {
171
- /**
172
- * If a number is provided, then that many files would run in parallel.
173
- * If truthy, it would run (number of cpu cores - 1) files in parallel.
174
- * If falsy, it would only run one file at a time.
175
- * If unspecified, subtests inherit this value from their parent.
176
- * @default true
177
- */
178
- concurrency?: number | boolean | undefined;
179
- /**
180
- * An array containing the list of files to run.
181
- * If unspecified, the test runner execution model will be used.
182
- */
183
- files?: readonly string[] | undefined;
184
- /**
185
- * Allows aborting an in-progress test execution.
186
- * @default undefined
187
- */
188
- signal?: AbortSignal | undefined;
189
- /**
190
- * A number of milliseconds the test will fail after.
191
- * If unspecified, subtests inherit this value from their parent.
192
- * @default Infinity
193
- */
194
- timeout?: number | undefined;
195
- /**
196
- * Sets inspector port of test child process.
197
- * If a nullish value is provided, each process gets its own port,
198
- * incremented from the primary's `process.debugPort`.
199
- */
200
- inspectPort?: number | (() => number) | undefined;
201
- /**
202
- * That can be used to only run tests whose name matches the provided pattern.
203
- * Test name patterns are interpreted as JavaScript regular expressions.
204
- * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run.
205
- */
206
- testNamePatterns?: string | RegExp | ReadonlyArray<string | RegExp> | undefined;
207
- /**
208
- * If truthy, the test context will only run tests that have the `only` option set
209
- * @since v18.19.0
210
- */
211
- only?: boolean | undefined;
212
- /**
213
- * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
214
- */
215
- setup?: ((reporter: TestsStream) => void | Promise<void>) | undefined;
216
- /**
217
- * Whether to run in watch mode or not.
218
- * @default false
219
- */
220
- watch?: boolean | undefined;
221
- /**
222
- * Running tests in a specific shard.
223
- * @since v18.19.0
224
- * @default undefined
225
- */
226
- shard?: TestShard | undefined;
227
- }
228
-
229
- /**
230
- * A successful call of the `run()` method will return a new `TestsStream` object,
231
- * streaming a series of events representing the execution of the tests.
232
- * `TestsStream` will emit events in the order of the tests' definitions.
233
- * @since v18.9.0
234
- */
235
- interface TestsStream extends NodeJS.ReadableStream {
236
- addListener(event: "test:coverage", listener: (data: TestCoverage) => void): this;
237
- addListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
238
- addListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
239
- addListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
240
- addListener(event: "test:fail", listener: (data: TestFail) => void): this;
241
- addListener(event: "test:pass", listener: (data: TestPass) => void): this;
242
- addListener(event: "test:plan", listener: (data: TestPlan) => void): this;
243
- addListener(event: "test:start", listener: (data: TestStart) => void): this;
244
- addListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
245
- addListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
246
- addListener(event: "test:watch:drained", listener: () => void): this;
247
- addListener(event: string, listener: (...args: any[]) => void): this;
248
- emit(event: "test:coverage", data: TestCoverage): boolean;
249
- emit(event: "test:dequeue", data: TestDequeue): boolean;
250
- emit(event: "test:diagnostic", data: DiagnosticData): boolean;
251
- emit(event: "test:enqueue", data: TestEnqueue): boolean;
252
- emit(event: "test:fail", data: TestFail): boolean;
253
- emit(event: "test:pass", data: TestPass): boolean;
254
- emit(event: "test:plan", data: TestPlan): boolean;
255
- emit(event: "test:start", data: TestStart): boolean;
256
- emit(event: "test:stderr", data: TestStderr): boolean;
257
- emit(event: "test:stdout", data: TestStdout): boolean;
258
- emit(event: "test:watch:drained"): boolean;
259
- emit(event: string | symbol, ...args: any[]): boolean;
260
- on(event: "test:coverage", listener: (data: TestCoverage) => void): this;
261
- on(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
262
- on(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
263
- on(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
264
- on(event: "test:fail", listener: (data: TestFail) => void): this;
265
- on(event: "test:pass", listener: (data: TestPass) => void): this;
266
- on(event: "test:plan", listener: (data: TestPlan) => void): this;
267
- on(event: "test:start", listener: (data: TestStart) => void): this;
268
- on(event: "test:stderr", listener: (data: TestStderr) => void): this;
269
- on(event: "test:stdout", listener: (data: TestStdout) => void): this;
270
- on(event: "test:watch:drained", listener: () => void): this;
271
- on(event: string, listener: (...args: any[]) => void): this;
272
- once(event: "test:coverage", listener: (data: TestCoverage) => void): this;
273
- once(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
274
- once(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
275
- once(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
276
- once(event: "test:fail", listener: (data: TestFail) => void): this;
277
- once(event: "test:pass", listener: (data: TestPass) => void): this;
278
- once(event: "test:plan", listener: (data: TestPlan) => void): this;
279
- once(event: "test:start", listener: (data: TestStart) => void): this;
280
- once(event: "test:stderr", listener: (data: TestStderr) => void): this;
281
- once(event: "test:stdout", listener: (data: TestStdout) => void): this;
282
- once(event: "test:watch:drained", listener: () => void): this;
283
- once(event: string, listener: (...args: any[]) => void): this;
284
- prependListener(event: "test:coverage", listener: (data: TestCoverage) => void): this;
285
- prependListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
286
- prependListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
287
- prependListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
288
- prependListener(event: "test:fail", listener: (data: TestFail) => void): this;
289
- prependListener(event: "test:pass", listener: (data: TestPass) => void): this;
290
- prependListener(event: "test:plan", listener: (data: TestPlan) => void): this;
291
- prependListener(event: "test:start", listener: (data: TestStart) => void): this;
292
- prependListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
293
- prependListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
294
- prependListener(event: "test:watch:drained", listener: () => void): this;
295
- prependListener(event: string, listener: (...args: any[]) => void): this;
296
- prependOnceListener(event: "test:coverage", listener: (data: TestCoverage) => void): this;
297
- prependOnceListener(event: "test:dequeue", listener: (data: TestDequeue) => void): this;
298
- prependOnceListener(event: "test:diagnostic", listener: (data: DiagnosticData) => void): this;
299
- prependOnceListener(event: "test:enqueue", listener: (data: TestEnqueue) => void): this;
300
- prependOnceListener(event: "test:fail", listener: (data: TestFail) => void): this;
301
- prependOnceListener(event: "test:pass", listener: (data: TestPass) => void): this;
302
- prependOnceListener(event: "test:plan", listener: (data: TestPlan) => void): this;
303
- prependOnceListener(event: "test:start", listener: (data: TestStart) => void): this;
304
- prependOnceListener(event: "test:stderr", listener: (data: TestStderr) => void): this;
305
- prependOnceListener(event: "test:stdout", listener: (data: TestStdout) => void): this;
306
- prependOnceListener(event: "test:watch:drained", listener: () => void): this;
307
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
308
- }
309
-
310
- /**
311
- * An instance of `TestContext` is passed to each test function in order to interact with the
312
- * test runner. However, the `TestContext` constructor is not exposed as part of the API.
313
- * @since v18.0.0
314
- */
315
- export interface TestContext {
316
- /**
317
- * This function is used to create a hook running before subtest of the current test.
318
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
319
- * If the hook uses callbacks, the callback function is passed as the second argument.
320
- * @param options Configuration options for the hook.
321
- * @since v18.17.0
322
- */
323
- before(fn?: TestContextHookFn, options?: HookOptions): void;
324
-
325
- /**
326
- * This function is used to create a hook running before each subtest of the current test.
327
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
328
- * If the hook uses callbacks, the callback function is passed as the second argument.
329
- * @param options Configuration options for the hook.
330
- * @since v18.8.0
331
- */
332
- beforeEach(fn?: TestContextHookFn, options?: HookOptions): void;
333
-
334
- /**
335
- * This function is used to create a hook that runs after the current test finishes.
336
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
337
- * If the hook uses callbacks, the callback function is passed as the second argument.
338
- * @param options Configuration options for the hook.
339
- * @since v18.13.0
340
- */
341
- after(fn?: TestContextHookFn, options?: HookOptions): void;
342
-
343
- /**
344
- * This function is used to create a hook running after each subtest of the current test.
345
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
346
- * If the hook uses callbacks, the callback function is passed as the second argument.
347
- * @param options Configuration options for the hook.
348
- * @since v18.8.0
349
- */
350
- afterEach(fn?: TestContextHookFn, options?: HookOptions): void;
351
-
352
- /**
353
- * This function is used to write diagnostics to the output. Any diagnostic information is
354
- * included at the end of the test's results. This function does not return a value.
355
- * @param message Message to be reported.
356
- * @since v18.0.0
357
- */
358
- diagnostic(message: string): void;
359
-
360
- /**
361
- * The name of the test.
362
- * @since v18.8.0
363
- */
364
- readonly name: string;
365
-
366
- /**
367
- * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
368
- * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
369
- * command-line option, this function is a no-op.
370
- * @param shouldRunOnlyTests Whether or not to run `only` tests.
371
- * @since v18.0.0
372
- */
373
- runOnly(shouldRunOnlyTests: boolean): void;
374
-
375
- /**
376
- * Can be used to abort test subtasks when the test has been aborted.
377
- * @since v18.7.0
378
- */
379
- readonly signal: AbortSignal;
380
-
381
- /**
382
- * This function causes the test's output to indicate the test as skipped. If `message` is
383
- * provided, it is included in the output. Calling `skip()` does not terminate execution of
384
- * the test function. This function does not return a value.
385
- * @param message Optional skip message.
386
- * @since v18.0.0
387
- */
388
- skip(message?: string): void;
389
-
390
- /**
391
- * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
392
- * included in the output. Calling `todo()` does not terminate execution of the test
393
- * function. This function does not return a value.
394
- * @param message Optional `TODO` message.
395
- * @since v18.0.0
396
- */
397
- todo(message?: string): void;
398
-
399
- /**
400
- * This function is used to create subtests under the current test. This function behaves in
401
- * the same fashion as the top level {@link test} function.
402
- * @since v18.0.0
403
- * @param name The name of the test, which is displayed when reporting test results.
404
- * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
405
- * @param options Configuration options for the test
406
- * @param fn The function under test. This first argument to this function is a
407
- * {@link TestContext} object. If the test uses callbacks, the callback function is
408
- * passed as the second argument. Default: A no-op function.
409
- * @returns A {@link Promise} resolved with `undefined` once the test completes.
410
- */
411
- test: typeof test;
412
- /**
413
- * Each test provides its own MockTracker instance.
414
- */
415
- readonly mock: MockTracker;
416
- }
417
-
418
- /**
419
- * An instance of `SuiteContext` is passed to each suite function in order to
420
- * interact with the test runner. However, the `SuiteContext` constructor is not
421
- * exposed as part of the API.
422
- * @since v18.7.0, v16.17.0
423
- */
424
- export interface SuiteContext {
425
- /**
426
- * The name of the suite.
427
- * @since v18.8.0, v16.18.0
428
- */
429
- readonly name: string;
430
- /**
431
- * Can be used to abort test subtasks when the test has been aborted.
432
- * @since v18.7.0, v16.17.0
433
- */
434
- readonly signal: AbortSignal;
435
- }
436
- interface TestOptions {
437
- /**
438
- * If a number is provided, then that many tests would run in parallel.
439
- * If truthy, it would run (number of cpu cores - 1) tests in parallel.
440
- * For subtests, it will be `Infinity` tests in parallel.
441
- * If falsy, it would only run one test at a time.
442
- * If unspecified, subtests inherit this value from their parent.
443
- * @default false
444
- */
445
- concurrency?: number | boolean | undefined;
446
-
447
- /**
448
- * If truthy, and the test context is configured to run `only` tests, then this test will be
449
- * run. Otherwise, the test is skipped.
450
- * @default false
451
- */
452
- only?: boolean | undefined;
453
-
454
- /**
455
- * Allows aborting an in-progress test.
456
- * @since v18.8.0
457
- */
458
- signal?: AbortSignal | undefined;
459
-
460
- /**
461
- * If truthy, the test is skipped. If a string is provided, that string is displayed in the
462
- * test results as the reason for skipping the test.
463
- * @default false
464
- */
465
- skip?: boolean | string | undefined;
466
-
467
- /**
468
- * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
469
- * value from their parent.
470
- * @default Infinity
471
- * @since v18.7.0
472
- */
473
- timeout?: number | undefined;
474
-
475
- /**
476
- * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
477
- * the test results as the reason why the test is `TODO`.
478
- * @default false
479
- */
480
- todo?: boolean | string | undefined;
481
- }
482
-
483
- /**
484
- * This function is used to create a hook running before running a suite.
485
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
486
- * the second argument. Default: A no-op function.
487
- * @param options Configuration options for the hook.
488
- * @since v18.8.0
489
- */
490
- function before(fn?: HookFn, options?: HookOptions): void;
491
-
492
- /**
493
- * This function is used to create a hook running after running a suite.
494
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
495
- * the second argument. Default: A no-op function.
496
- * @param options Configuration options for the hook.
497
- * @since v18.8.0
498
- */
499
- function after(fn?: HookFn, options?: HookOptions): void;
500
-
501
- /**
502
- * This function is used to create a hook running before each subtest of the current suite.
503
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
504
- * the second argument. Default: A no-op function.
505
- * @param options Configuration options for the hook.
506
- * @since v18.8.0
507
- */
508
- function beforeEach(fn?: HookFn, options?: HookOptions): void;
509
-
510
- /**
511
- * This function is used to create a hook running after each subtest of the current test.
512
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
513
- * the second argument. Default: A no-op function.
514
- * @param options Configuration options for the hook.
515
- * @since v18.8.0
516
- */
517
- function afterEach(fn?: HookFn, options?: HookOptions): void;
518
-
519
- /**
520
- * The hook function. The first argument is the context in which the hook is called.
521
- * If the hook uses callbacks, the callback function is passed as the second argument.
522
- */
523
- type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any;
524
-
525
- /**
526
- * The hook function. The first argument is a `TestContext` object.
527
- * If the hook uses callbacks, the callback function is passed as the second argument.
528
- */
529
- type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any;
530
-
531
- /**
532
- * Configuration options for hooks.
533
- * @since v18.8.0
534
- */
535
- interface HookOptions {
536
- /**
537
- * Allows aborting an in-progress hook.
538
- */
539
- signal?: AbortSignal | undefined;
540
-
541
- /**
542
- * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
543
- * value from their parent.
544
- * @default Infinity
545
- */
546
- timeout?: number | undefined;
547
- }
548
-
549
- interface MockFunctionOptions {
550
- /**
551
- * The number of times that the mock will use the behavior of `implementation`.
552
- * Once the mock function has been called `times` times,
553
- * it will automatically restore the behavior of `original`.
554
- * This value must be an integer greater than zero.
555
- * @default Infinity
556
- */
557
- times?: number | undefined;
558
- }
559
-
560
- interface MockMethodOptions extends MockFunctionOptions {
561
- /**
562
- * If `true`, `object[methodName]` is treated as a getter.
563
- * This option cannot be used with the `setter` option.
564
- */
565
- getter?: boolean | undefined;
566
-
567
- /**
568
- * If `true`, `object[methodName]` is treated as a setter.
569
- * This option cannot be used with the `getter` option.
570
- */
571
- setter?: boolean | undefined;
572
- }
573
-
574
- type Mock<F extends Function> = F & {
575
- mock: MockFunctionContext<F>;
576
- };
577
-
578
- type NoOpFunction = (...args: any[]) => undefined;
579
-
580
- type FunctionPropertyNames<T> = {
581
- [K in keyof T]: T[K] extends Function ? K : never;
582
- }[keyof T];
583
-
584
- interface MockTracker {
585
- /**
586
- * This function is used to create a mock function.
587
- * @param original An optional function to create a mock on.
588
- * @param implementation An optional function used as the mock implementation for `original`.
589
- * This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.
590
- * @param options Optional configuration options for the mock function.
591
- */
592
- fn<F extends Function = NoOpFunction>(original?: F, options?: MockFunctionOptions): Mock<F>;
593
- fn<F extends Function = NoOpFunction, Implementation extends Function = F>(
594
- original?: F,
595
- implementation?: Implementation,
596
- options?: MockFunctionOptions,
597
- ): Mock<F | Implementation>;
598
- /**
599
- * This function is used to create a mock on an existing object method.
600
- * @param object The object whose method is being mocked.
601
- * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
602
- * @param implementation An optional function used as the mock implementation for `object[methodName]`.
603
- * @param options Optional configuration options for the mock method.
604
- */
605
- method<
606
- MockedObject extends object,
607
- MethodName extends FunctionPropertyNames<MockedObject>,
608
- >(
609
- object: MockedObject,
610
- methodName: MethodName,
611
- options?: MockFunctionOptions,
612
- ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
613
- : never;
614
- method<
615
- MockedObject extends object,
616
- MethodName extends FunctionPropertyNames<MockedObject>,
617
- Implementation extends Function,
618
- >(
619
- object: MockedObject,
620
- methodName: MethodName,
621
- implementation: Implementation,
622
- options?: MockFunctionOptions,
623
- ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
624
- : never;
625
- method<MockedObject extends object>(
626
- object: MockedObject,
627
- methodName: keyof MockedObject,
628
- options: MockMethodOptions,
629
- ): Mock<Function>;
630
- method<MockedObject extends object>(
631
- object: MockedObject,
632
- methodName: keyof MockedObject,
633
- implementation: Function,
634
- options: MockMethodOptions,
635
- ): Mock<Function>;
636
- /**
637
- * This function is syntax sugar for {@link MockTracker.method} with `options.getter` set to `true`.
638
- */
639
- getter<
640
- MockedObject extends object,
641
- MethodName extends keyof MockedObject,
642
- >(
643
- object: MockedObject,
644
- methodName: MethodName,
645
- options?: MockFunctionOptions,
646
- ): Mock<() => MockedObject[MethodName]>;
647
- getter<
648
- MockedObject extends object,
649
- MethodName extends keyof MockedObject,
650
- Implementation extends Function,
651
- >(
652
- object: MockedObject,
653
- methodName: MethodName,
654
- implementation?: Implementation,
655
- options?: MockFunctionOptions,
656
- ): Mock<(() => MockedObject[MethodName]) | Implementation>;
657
- /**
658
- * This function is syntax sugar for {@link MockTracker.method} with `options.setter` set to `true`.
659
- */
660
- setter<
661
- MockedObject extends object,
662
- MethodName extends keyof MockedObject,
663
- >(
664
- object: MockedObject,
665
- methodName: MethodName,
666
- options?: MockFunctionOptions,
667
- ): Mock<(value: MockedObject[MethodName]) => void>;
668
- setter<
669
- MockedObject extends object,
670
- MethodName extends keyof MockedObject,
671
- Implementation extends Function,
672
- >(
673
- object: MockedObject,
674
- methodName: MethodName,
675
- implementation?: Implementation,
676
- options?: MockFunctionOptions,
677
- ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
678
- /**
679
- * This function restores the default behavior of all mocks that were previously created by this `MockTracker`
680
- * and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used,
681
- * but the `MockTracker` instance can no longer be used to reset their behavior or otherwise interact with them.
682
- *
683
- * After each test completes, this function is called on the test context's `MockTracker`.
684
- * If the global `MockTracker` is used extensively, calling this function manually is recommended.
685
- */
686
- reset(): void;
687
- /**
688
- * This function restores the default behavior of all mocks that were previously created by this `MockTracker`.
689
- * Unlike `mock.reset()`, `mock.restoreAll()` does not disassociate the mocks from the `MockTracker` instance.
690
- */
691
- restoreAll(): void;
692
- timers: MockTimers;
693
- }
694
-
695
- const mock: MockTracker;
696
-
697
- interface MockFunctionCall<
698
- F extends Function,
699
- ReturnType = F extends (...args: any) => infer T ? T
700
- : F extends abstract new(...args: any) => infer T ? T
701
- : unknown,
702
- Args = F extends (...args: infer Y) => any ? Y
703
- : F extends abstract new(...args: infer Y) => any ? Y
704
- : unknown[],
705
- > {
706
- /**
707
- * An array of the arguments passed to the mock function.
708
- */
709
- arguments: Args;
710
- /**
711
- * If the mocked function threw then this property contains the thrown value.
712
- */
713
- error: unknown | undefined;
714
- /**
715
- * The value returned by the mocked function.
716
- *
717
- * If the mocked function threw, it will be `undefined`.
718
- */
719
- result: ReturnType | undefined;
720
- /**
721
- * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
722
- */
723
- stack: Error;
724
- /**
725
- * If the mocked function is a constructor, this field contains the class being constructed.
726
- * Otherwise this will be `undefined`.
727
- */
728
- target: F extends abstract new(...args: any) => any ? F : undefined;
729
- /**
730
- * The mocked function's `this` value.
731
- */
732
- this: unknown;
733
- }
734
-
735
- interface MockFunctionContext<F extends Function> {
736
- /**
737
- * A getter that returns a copy of the internal array used to track calls to the mock.
738
- */
739
- readonly calls: Array<MockFunctionCall<F>>;
740
-
741
- /**
742
- * This function returns the number of times that this mock has been invoked.
743
- * This function is more efficient than checking `ctx.calls.length`
744
- * because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
745
- */
746
- callCount(): number;
747
-
748
- /**
749
- * This function is used to change the behavior of an existing mock.
750
- * @param implementation The function to be used as the mock's new implementation.
751
- */
752
- mockImplementation(implementation: F): void;
753
-
754
- /**
755
- * This function is used to change the behavior of an existing mock for a single invocation.
756
- * Once invocation `onCall` has occurred, the mock will revert to whatever behavior
757
- * it would have used had `mockImplementationOnce()` not been called.
758
- * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
759
- * @param onCall The invocation number that will use `implementation`.
760
- * If the specified invocation has already occurred then an exception is thrown.
761
- */
762
- mockImplementationOnce(implementation: F, onCall?: number): void;
763
-
764
- /**
765
- * Resets the call history of the mock function.
766
- */
767
- resetCalls(): void;
768
-
769
- /**
770
- * Resets the implementation of the mock function to its original behavior.
771
- * The mock can still be used after calling this function.
772
- */
773
- restore(): void;
774
- }
775
-
776
- type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout";
777
- /**
778
- * Mocking timers is a technique commonly used in software testing to simulate and
779
- * control the behavior of timers, such as `setInterval` and `setTimeout`,
780
- * without actually waiting for the specified time intervals.
781
- *
782
- * The `MockTracker` provides a top-level `timers` export
783
- * which is a `MockTimers` instance.
784
- * @since v18.19.0
785
- * @experimental
786
- */
787
- class MockTimers {
788
- /**
789
- * Enables timer mocking for the specified timers.
790
- *
791
- * **Note:** When you enable mocking for a specific timer, its associated
792
- * clear function will also be implicitly mocked.
793
- *
794
- * Example usage:
795
- *
796
- * ```js
797
- * import { mock } from 'node:test';
798
- * mock.timers.enable(['setInterval']);
799
- * ```
800
- *
801
- * The above example enables mocking for the `setInterval` timer and
802
- * implicitly mocks the `clearInterval` function. Only the `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and`globalThis` will be mocked.
803
- *
804
- * Alternatively, if you call `mock.timers.enable()` without any parameters:
805
- *
806
- * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`)
807
- * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`,
808
- * and `globalThis` will be mocked.
809
- * @since v18.19.0
810
- */
811
- enable(timers?: Timer[]): void;
812
- /**
813
- * This function restores the default behavior of all mocks that were previously
814
- * created by this `MockTimers` instance and disassociates the mocks
815
- * from the `MockTracker` instance.
816
- *
817
- * **Note:** After each test completes, this function is called on
818
- * the test context's `MockTracker`.
819
- *
820
- * ```js
821
- * import { mock } from 'node:test';
822
- * mock.timers.reset();
823
- * ```
824
- * @since v18.19.0
825
- */
826
- reset(): void;
827
- /**
828
- * Advances time for all mocked timers.
829
- *
830
- * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts
831
- * only positive numbers. In Node.js, `setTimeout` with negative numbers is
832
- * only supported for web compatibility reasons.
833
- *
834
- * The following example mocks a `setTimeout` function and
835
- * by using `.tick` advances in
836
- * time triggering all pending timers.
837
- *
838
- * ```js
839
- * import assert from 'node:assert';
840
- * import { test } from 'node:test';
841
- *
842
- * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
843
- * const fn = context.mock.fn();
844
- *
845
- * context.mock.timers.enable(['setTimeout']);
846
- *
847
- * setTimeout(fn, 9999);
848
- *
849
- * assert.strictEqual(fn.mock.callCount(), 0);
850
- *
851
- * // Advance in time
852
- * context.mock.timers.tick(9999);
853
- *
854
- * assert.strictEqual(fn.mock.callCount(), 1);
855
- * });
856
- * ```
857
- *
858
- * Alternativelly, the `.tick` function can be called many times
859
- *
860
- * ```js
861
- * import assert from 'node:assert';
862
- * import { test } from 'node:test';
863
- *
864
- * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
865
- * const fn = context.mock.fn();
866
- * context.mock.timers.enable(['setTimeout']);
867
- * const nineSecs = 9000;
868
- * setTimeout(fn, nineSecs);
869
- *
870
- * const twoSeconds = 3000;
871
- * context.mock.timers.tick(twoSeconds);
872
- * context.mock.timers.tick(twoSeconds);
873
- * context.mock.timers.tick(twoSeconds);
874
- *
875
- * assert.strictEqual(fn.mock.callCount(), 1);
876
- * });
877
- * ```
878
- * @since v18.19.0
879
- */
880
- tick(milliseconds: number): void;
881
- /**
882
- * Triggers all pending mocked timers immediately.
883
- *
884
- * The example below triggers all pending timers immediately,
885
- * causing them to execute without any delay.
886
- *
887
- * ```js
888
- * import assert from 'node:assert';
889
- * import { test } from 'node:test';
890
- *
891
- * test('runAll functions following the given order', (context) => {
892
- * context.mock.timers.enable(['setTimeout']);
893
- * const results = [];
894
- * setTimeout(() => results.push(1), 9999);
895
- *
896
- * // Notice that if both timers have the same timeout,
897
- * // the order of execution is guaranteed
898
- * setTimeout(() => results.push(3), 8888);
899
- * setTimeout(() => results.push(2), 8888);
900
- *
901
- * assert.deepStrictEqual(results, []);
902
- *
903
- * context.mock.timers.runAll();
904
- *
905
- * assert.deepStrictEqual(results, [3, 2, 1]);
906
- * });
907
- * ```
908
- *
909
- * **Note:** The `runAll()` function is specifically designed for
910
- * triggering timers in the context of timer mocking.
911
- * It does not have any effect on real-time system
912
- * clocks or actual timers outside of the mocking environment.
913
- * @since v18.19.0
914
- */
915
- runAll(): void;
916
- /**
917
- * Calls {@link MockTimers.reset()}.
918
- */
919
- [Symbol.dispose](): void;
920
- }
921
-
922
- export { after, afterEach, before, beforeEach, describe, it, mock, run, test, test as default };
923
- }
924
-
925
- interface TestError extends Error {
926
- cause: Error;
927
- }
928
- interface TestLocationInfo {
929
- /**
930
- * The column number where the test is defined, or
931
- * `undefined` if the test was run through the REPL.
932
- */
933
- column?: number;
934
- /**
935
- * The path of the test file, `undefined` if test is not ran through a file.
936
- */
937
- file?: string;
938
- /**
939
- * The line number where the test is defined, or
940
- * `undefined` if the test was run through the REPL.
941
- */
942
- line?: number;
943
- }
944
- interface DiagnosticData extends TestLocationInfo {
945
- /**
946
- * The diagnostic message.
947
- */
948
- message: string;
949
- /**
950
- * The nesting level of the test.
951
- */
952
- nesting: number;
953
- }
954
- interface TestCoverage {
955
- /**
956
- * An object containing the coverage report.
957
- */
958
- summary: {
959
- /**
960
- * An array of coverage reports for individual files.
961
- */
962
- files: Array<{
963
- /**
964
- * The absolute path of the file.
965
- */
966
- path: string;
967
- /**
968
- * The total number of lines.
969
- */
970
- totalLineCount: number;
971
- /**
972
- * The total number of branches.
973
- */
974
- totalBranchCount: number;
975
- /**
976
- * The total number of functions.
977
- */
978
- totalFunctionCount: number;
979
- /**
980
- * The number of covered lines.
981
- */
982
- coveredLineCount: number;
983
- /**
984
- * The number of covered branches.
985
- */
986
- coveredBranchCount: number;
987
- /**
988
- * The number of covered functions.
989
- */
990
- coveredFunctionCount: number;
991
- /**
992
- * The percentage of lines covered.
993
- */
994
- coveredLinePercent: number;
995
- /**
996
- * The percentage of branches covered.
997
- */
998
- coveredBranchPercent: number;
999
- /**
1000
- * The percentage of functions covered.
1001
- */
1002
- coveredFunctionPercent: number;
1003
- /**
1004
- * An array of integers representing line numbers that are uncovered.
1005
- */
1006
- uncoveredLineNumbers: number[];
1007
- }>;
1008
- /**
1009
- * An object containing a summary of coverage for all files.
1010
- */
1011
- totals: {
1012
- /**
1013
- * The total number of lines.
1014
- */
1015
- totalLineCount: number;
1016
- /**
1017
- * The total number of branches.
1018
- */
1019
- totalBranchCount: number;
1020
- /**
1021
- * The total number of functions.
1022
- */
1023
- totalFunctionCount: number;
1024
- /**
1025
- * The number of covered lines.
1026
- */
1027
- coveredLineCount: number;
1028
- /**
1029
- * The number of covered branches.
1030
- */
1031
- coveredBranchCount: number;
1032
- /**
1033
- * The number of covered functions.
1034
- */
1035
- coveredFunctionCount: number;
1036
- /**
1037
- * The percentage of lines covered.
1038
- */
1039
- coveredLinePercent: number;
1040
- /**
1041
- * The percentage of branches covered.
1042
- */
1043
- coveredBranchPercent: number;
1044
- /**
1045
- * The percentage of functions covered.
1046
- */
1047
- coveredFunctionPercent: number;
1048
- };
1049
- /**
1050
- * The working directory when code coverage began. This
1051
- * is useful for displaying relative path names in case
1052
- * the tests changed the working directory of the Node.js process.
1053
- */
1054
- workingDirectory: string;
1055
- };
1056
- /**
1057
- * The nesting level of the test.
1058
- */
1059
- nesting: number;
1060
- }
1061
- interface TestDequeue extends TestLocationInfo {
1062
- /**
1063
- * The test name
1064
- */
1065
- name: string;
1066
- /**
1067
- * The nesting level of the test.
1068
- */
1069
- nesting: number;
1070
- }
1071
- interface TestEnqueue extends TestLocationInfo {
1072
- /**
1073
- * The test name
1074
- */
1075
- name: string;
1076
- /**
1077
- * The nesting level of the test.
1078
- */
1079
- nesting: number;
1080
- }
1081
- interface TestFail extends TestLocationInfo {
1082
- /**
1083
- * Additional execution metadata.
1084
- */
1085
- details: {
1086
- /**
1087
- * The duration of the test in milliseconds.
1088
- */
1089
- duration_ms: number;
1090
- /**
1091
- * The error thrown by the test.
1092
- */
1093
- error: TestError;
1094
- /**
1095
- * The type of the test, used to denote whether this is a suite.
1096
- * @since 18.17.0
1097
- */
1098
- type?: "suite";
1099
- };
1100
- /**
1101
- * The test name.
1102
- */
1103
- name: string;
1104
- /**
1105
- * The nesting level of the test.
1106
- */
1107
- nesting: number;
1108
- /**
1109
- * The ordinal number of the test.
1110
- */
1111
- testNumber: number;
1112
- /**
1113
- * Present if `context.todo` is called.
1114
- */
1115
- todo?: string | boolean;
1116
- /**
1117
- * Present if `context.skip` is called.
1118
- */
1119
- skip?: string | boolean;
1120
- }
1121
- interface TestPass extends TestLocationInfo {
1122
- /**
1123
- * Additional execution metadata.
1124
- */
1125
- details: {
1126
- /**
1127
- * The duration of the test in milliseconds.
1128
- */
1129
- duration_ms: number;
1130
- /**
1131
- * The type of the test, used to denote whether this is a suite.
1132
- * @since 18.17.0
1133
- */
1134
- type?: "suite";
1135
- };
1136
- /**
1137
- * The test name.
1138
- */
1139
- name: string;
1140
- /**
1141
- * The nesting level of the test.
1142
- */
1143
- nesting: number;
1144
- /**
1145
- * The ordinal number of the test.
1146
- */
1147
- testNumber: number;
1148
- /**
1149
- * Present if `context.todo` is called.
1150
- */
1151
- todo?: string | boolean;
1152
- /**
1153
- * Present if `context.skip` is called.
1154
- */
1155
- skip?: string | boolean;
1156
- }
1157
- interface TestPlan extends TestLocationInfo {
1158
- /**
1159
- * The nesting level of the test.
1160
- */
1161
- nesting: number;
1162
- /**
1163
- * The number of subtests that have ran.
1164
- */
1165
- count: number;
1166
- }
1167
- interface TestStart extends TestLocationInfo {
1168
- /**
1169
- * The test name.
1170
- */
1171
- name: string;
1172
- /**
1173
- * The nesting level of the test.
1174
- */
1175
- nesting: number;
1176
- }
1177
- interface TestStderr extends TestLocationInfo {
1178
- /**
1179
- * The message written to `stderr`
1180
- */
1181
- message: string;
1182
- }
1183
- interface TestStdout extends TestLocationInfo {
1184
- /**
1185
- * The message written to `stdout`
1186
- */
1187
- message: string;
1188
- }
1189
-
1190
- /**
1191
- * The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
1192
- * To access it:
1193
- *
1194
- * ```js
1195
- * import test from 'node:test/reporters';
1196
- * ```
1197
- *
1198
- * This module is only available under the `node:` scheme. The following will not
1199
- * work:
1200
- *
1201
- * ```js
1202
- * import test from 'test/reporters';
1203
- * ```
1204
- * @since v18.17.0
1205
- * @see [source](https://github.com/nodejs/node/blob/v18.17.0/lib/test/reporters.js)
1206
- */
1207
- declare module "node:test/reporters" {
1208
- import { Transform } from "node:stream";
1209
-
1210
- type TestEvent =
1211
- | { type: "test:coverage"; data: TestCoverage }
1212
- | { type: "test:dequeue"; data: TestDequeue }
1213
- | { type: "test:diagnostic"; data: DiagnosticData }
1214
- | { type: "test:enqueue"; data: TestEnqueue }
1215
- | { type: "test:fail"; data: TestFail }
1216
- | { type: "test:pass"; data: TestPass }
1217
- | { type: "test:plan"; data: TestPlan }
1218
- | { type: "test:start"; data: TestStart }
1219
- | { type: "test:stderr"; data: TestStderr }
1220
- | { type: "test:stdout"; data: TestStdout }
1221
- | { type: "test:watch:drained"; data: undefined };
1222
- type TestEventGenerator = AsyncGenerator<TestEvent, void>;
1223
-
1224
- /**
1225
- * The `dot` reporter outputs the test results in a compact format,
1226
- * where each passing test is represented by a `.`,
1227
- * and each failing test is represented by a `X`.
1228
- */
1229
- function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
1230
- /**
1231
- * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
1232
- */
1233
- function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
1234
- /**
1235
- * The `spec` reporter outputs the test results in a human-readable format.
1236
- */
1237
- class Spec extends Transform {
1238
- constructor();
1239
- }
1240
- /**
1241
- * The `junit` reporter outputs test results in a jUnit XML format
1242
- */
1243
- function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
1244
- export { dot, junit, Spec as spec, tap, TestEvent };
1245
- }