@hasna/connectors 1.3.10 → 1.3.12

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 (676) hide show
  1. package/README.md +29 -348
  2. package/bin/index.js +8804 -6464
  3. package/bin/mcp.js +4347 -3066
  4. package/bin/serve.js +3581 -3025
  5. package/dashboard/dist/assets/index-ClBXkNbL.css +1 -0
  6. package/dashboard/dist/assets/index-CwLL4Zbv.js +284 -0
  7. package/dashboard/dist/index.html +2 -2
  8. package/dist/db/agents.d.ts +1 -1
  9. package/dist/db/database.d.ts +3 -2
  10. package/dist/db/database.test.d.ts +1 -0
  11. package/dist/db/jobs.d.ts +1 -1
  12. package/dist/db/locks.d.ts +1 -1
  13. package/dist/db/promotions.d.ts +1 -1
  14. package/dist/db/rate.d.ts +1 -1
  15. package/dist/db/usage.d.ts +1 -1
  16. package/dist/db/workflows.d.ts +1 -1
  17. package/dist/index.js +3843 -3152
  18. package/dist/lib/scheduler.d.ts +3 -1
  19. package/dist/lib/workflow-runner.test.d.ts +1 -0
  20. package/package.json +2 -2
  21. package/connectors/connect-yousign/bun.lock +0 -32
  22. package/connectors/connect-yousign/node_modules/@types/bun/LICENSE +0 -21
  23. package/connectors/connect-yousign/node_modules/@types/bun/README.md +0 -20
  24. package/connectors/connect-yousign/node_modules/@types/bun/index.d.ts +0 -1
  25. package/connectors/connect-yousign/node_modules/@types/bun/package.json +0 -53
  26. package/connectors/connect-yousign/node_modules/@types/node/LICENSE +0 -21
  27. package/connectors/connect-yousign/node_modules/@types/node/README.md +0 -15
  28. package/connectors/connect-yousign/node_modules/@types/node/assert/strict.d.ts +0 -105
  29. package/connectors/connect-yousign/node_modules/@types/node/assert.d.ts +0 -955
  30. package/connectors/connect-yousign/node_modules/@types/node/async_hooks.d.ts +0 -623
  31. package/connectors/connect-yousign/node_modules/@types/node/buffer.buffer.d.ts +0 -466
  32. package/connectors/connect-yousign/node_modules/@types/node/buffer.d.ts +0 -1810
  33. package/connectors/connect-yousign/node_modules/@types/node/child_process.d.ts +0 -1433
  34. package/connectors/connect-yousign/node_modules/@types/node/cluster.d.ts +0 -486
  35. package/connectors/connect-yousign/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  36. package/connectors/connect-yousign/node_modules/@types/node/console.d.ts +0 -151
  37. package/connectors/connect-yousign/node_modules/@types/node/constants.d.ts +0 -20
  38. package/connectors/connect-yousign/node_modules/@types/node/crypto.d.ts +0 -4065
  39. package/connectors/connect-yousign/node_modules/@types/node/dgram.d.ts +0 -564
  40. package/connectors/connect-yousign/node_modules/@types/node/diagnostics_channel.d.ts +0 -576
  41. package/connectors/connect-yousign/node_modules/@types/node/dns/promises.d.ts +0 -503
  42. package/connectors/connect-yousign/node_modules/@types/node/dns.d.ts +0 -922
  43. package/connectors/connect-yousign/node_modules/@types/node/domain.d.ts +0 -166
  44. package/connectors/connect-yousign/node_modules/@types/node/events.d.ts +0 -1047
  45. package/connectors/connect-yousign/node_modules/@types/node/fs/promises.d.ts +0 -1329
  46. package/connectors/connect-yousign/node_modules/@types/node/fs.d.ts +0 -4678
  47. package/connectors/connect-yousign/node_modules/@types/node/globals.d.ts +0 -150
  48. package/connectors/connect-yousign/node_modules/@types/node/globals.typedarray.d.ts +0 -101
  49. package/connectors/connect-yousign/node_modules/@types/node/http.d.ts +0 -2188
  50. package/connectors/connect-yousign/node_modules/@types/node/http2.d.ts +0 -2480
  51. package/connectors/connect-yousign/node_modules/@types/node/https.d.ts +0 -405
  52. package/connectors/connect-yousign/node_modules/@types/node/index.d.ts +0 -115
  53. package/connectors/connect-yousign/node_modules/@types/node/inspector/promises.d.ts +0 -41
  54. package/connectors/connect-yousign/node_modules/@types/node/inspector.d.ts +0 -269
  55. package/connectors/connect-yousign/node_modules/@types/node/inspector.generated.d.ts +0 -4401
  56. package/connectors/connect-yousign/node_modules/@types/node/module.d.ts +0 -757
  57. package/connectors/connect-yousign/node_modules/@types/node/net.d.ts +0 -933
  58. package/connectors/connect-yousign/node_modules/@types/node/os.d.ts +0 -507
  59. package/connectors/connect-yousign/node_modules/@types/node/package.json +0 -155
  60. package/connectors/connect-yousign/node_modules/@types/node/path/posix.d.ts +0 -8
  61. package/connectors/connect-yousign/node_modules/@types/node/path/win32.d.ts +0 -8
  62. package/connectors/connect-yousign/node_modules/@types/node/path.d.ts +0 -187
  63. package/connectors/connect-yousign/node_modules/@types/node/perf_hooks.d.ts +0 -643
  64. package/connectors/connect-yousign/node_modules/@types/node/process.d.ts +0 -2175
  65. package/connectors/connect-yousign/node_modules/@types/node/punycode.d.ts +0 -117
  66. package/connectors/connect-yousign/node_modules/@types/node/querystring.d.ts +0 -152
  67. package/connectors/connect-yousign/node_modules/@types/node/quic.d.ts +0 -910
  68. package/connectors/connect-yousign/node_modules/@types/node/readline/promises.d.ts +0 -161
  69. package/connectors/connect-yousign/node_modules/@types/node/readline.d.ts +0 -542
  70. package/connectors/connect-yousign/node_modules/@types/node/repl.d.ts +0 -415
  71. package/connectors/connect-yousign/node_modules/@types/node/sea.d.ts +0 -162
  72. package/connectors/connect-yousign/node_modules/@types/node/sqlite.d.ts +0 -1065
  73. package/connectors/connect-yousign/node_modules/@types/node/stream/consumers.d.ts +0 -38
  74. package/connectors/connect-yousign/node_modules/@types/node/stream/promises.d.ts +0 -211
  75. package/connectors/connect-yousign/node_modules/@types/node/stream/web.d.ts +0 -296
  76. package/connectors/connect-yousign/node_modules/@types/node/stream.d.ts +0 -1770
  77. package/connectors/connect-yousign/node_modules/@types/node/string_decoder.d.ts +0 -67
  78. package/connectors/connect-yousign/node_modules/@types/node/test/reporters.d.ts +0 -96
  79. package/connectors/connect-yousign/node_modules/@types/node/test.d.ts +0 -2275
  80. package/connectors/connect-yousign/node_modules/@types/node/timers/promises.d.ts +0 -108
  81. package/connectors/connect-yousign/node_modules/@types/node/timers.d.ts +0 -159
  82. package/connectors/connect-yousign/node_modules/@types/node/tls.d.ts +0 -1203
  83. package/connectors/connect-yousign/node_modules/@types/node/trace_events.d.ts +0 -197
  84. package/connectors/connect-yousign/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -462
  85. package/connectors/connect-yousign/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  86. package/connectors/connect-yousign/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -36
  87. package/connectors/connect-yousign/node_modules/@types/node/ts5.6/index.d.ts +0 -117
  88. package/connectors/connect-yousign/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  89. package/connectors/connect-yousign/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  90. package/connectors/connect-yousign/node_modules/@types/node/tty.d.ts +0 -250
  91. package/connectors/connect-yousign/node_modules/@types/node/url.d.ts +0 -541
  92. package/connectors/connect-yousign/node_modules/@types/node/util/types.d.ts +0 -558
  93. package/connectors/connect-yousign/node_modules/@types/node/util.d.ts +0 -1687
  94. package/connectors/connect-yousign/node_modules/@types/node/v8.d.ts +0 -988
  95. package/connectors/connect-yousign/node_modules/@types/node/vm.d.ts +0 -1208
  96. package/connectors/connect-yousign/node_modules/@types/node/wasi.d.ts +0 -202
  97. package/connectors/connect-yousign/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -59
  98. package/connectors/connect-yousign/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  99. package/connectors/connect-yousign/node_modules/@types/node/web-globals/console.d.ts +0 -9
  100. package/connectors/connect-yousign/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  101. package/connectors/connect-yousign/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  102. package/connectors/connect-yousign/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  103. package/connectors/connect-yousign/node_modules/@types/node/web-globals/events.d.ts +0 -106
  104. package/connectors/connect-yousign/node_modules/@types/node/web-globals/fetch.d.ts +0 -69
  105. package/connectors/connect-yousign/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  106. package/connectors/connect-yousign/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  107. package/connectors/connect-yousign/node_modules/@types/node/web-globals/navigator.d.ts +0 -25
  108. package/connectors/connect-yousign/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  109. package/connectors/connect-yousign/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  110. package/connectors/connect-yousign/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  111. package/connectors/connect-yousign/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  112. package/connectors/connect-yousign/node_modules/@types/node/web-globals/url.d.ts +0 -24
  113. package/connectors/connect-yousign/node_modules/@types/node/worker_threads.d.ts +0 -717
  114. package/connectors/connect-yousign/node_modules/@types/node/zlib.d.ts +0 -682
  115. package/connectors/connect-yousign/node_modules/bun-types/CLAUDE.md +0 -105
  116. package/connectors/connect-yousign/node_modules/bun-types/README.md +0 -33
  117. package/connectors/connect-yousign/node_modules/bun-types/bun.d.ts +0 -8481
  118. package/connectors/connect-yousign/node_modules/bun-types/bun.ns.d.ts +0 -5
  119. package/connectors/connect-yousign/node_modules/bun-types/bundle.d.ts +0 -74
  120. package/connectors/connect-yousign/node_modules/bun-types/deprecated.d.ts +0 -184
  121. package/connectors/connect-yousign/node_modules/bun-types/devserver.d.ts +0 -187
  122. package/connectors/connect-yousign/node_modules/bun-types/docs/README.md +0 -28
  123. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/bytecode.mdx +0 -447
  124. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/css.mdx +0 -1024
  125. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/esbuild.mdx +0 -304
  126. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/executables.mdx +0 -1318
  127. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/fullstack.mdx +0 -1086
  128. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/hot-reloading.mdx +0 -229
  129. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/html-static.mdx +0 -498
  130. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/index.mdx +0 -1840
  131. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/loaders.mdx +0 -451
  132. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/macros.mdx +0 -328
  133. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/minifier.mdx +0 -1286
  134. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/plugins.mdx +0 -477
  135. package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/standalone-html.mdx +0 -314
  136. package/connectors/connect-yousign/node_modules/bun-types/docs/feedback.mdx +0 -75
  137. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-array.mdx +0 -29
  138. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-blob.mdx +0 -26
  139. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-buffer.mdx +0 -27
  140. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-string.mdx +0 -17
  141. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-typedarray.mdx +0 -41
  142. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-arraybuffer.mdx +0 -16
  143. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-dataview.mdx +0 -16
  144. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-stream.mdx +0 -16
  145. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-string.mdx +0 -17
  146. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-typedarray.mdx +0 -16
  147. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-arraybuffer.mdx +0 -16
  148. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-blob.mdx +0 -16
  149. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-readablestream.mdx +0 -43
  150. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-string.mdx +0 -27
  151. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-typedarray.mdx +0 -16
  152. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/dataview-to-string.mdx +0 -17
  153. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-arraybuffer.mdx +0 -27
  154. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-blob.mdx +0 -18
  155. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-buffer.mdx +0 -16
  156. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-dataview.mdx +0 -16
  157. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-readablestream.mdx +0 -43
  158. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-string.mdx +0 -18
  159. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/aws-lambda.mdx +0 -204
  160. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/digital-ocean.mdx +0 -161
  161. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/google-cloud-run.mdx +0 -194
  162. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/railway.mdx +0 -145
  163. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/render.mdx +0 -82
  164. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/vercel.mdx +0 -97
  165. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/astro.mdx +0 -82
  166. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/discordjs.mdx +0 -80
  167. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/docker.mdx +0 -151
  168. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/drizzle.mdx +0 -195
  169. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/elysia.mdx +0 -31
  170. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/express.mdx +0 -43
  171. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/gel.mdx +0 -261
  172. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/hono.mdx +0 -47
  173. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/mongoose.mdx +0 -92
  174. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/neon-drizzle.mdx +0 -234
  175. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/neon-serverless-postgres.mdx +0 -60
  176. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/nextjs.mdx +0 -103
  177. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/nuxt.mdx +0 -96
  178. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/pm2.mdx +0 -55
  179. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/prisma-postgres.mdx +0 -169
  180. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/prisma.mdx +0 -164
  181. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/qwik.mdx +0 -114
  182. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/react.mdx +0 -52
  183. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/remix.mdx +0 -97
  184. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/sentry.mdx +0 -54
  185. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/solidstart.mdx +0 -62
  186. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/ssr-react.mdx +0 -49
  187. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/stric.mdx +0 -54
  188. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/sveltekit.mdx +0 -138
  189. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/systemd.mdx +0 -114
  190. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/tanstack-start.mdx +0 -791
  191. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/upstash.mdx +0 -87
  192. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/vite.mdx +0 -77
  193. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/html-rewriter/extract-links.mdx +0 -71
  194. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/html-rewriter/extract-social-meta.mdx +0 -97
  195. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/cluster.mdx +0 -69
  196. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/fetch-unix.mdx +0 -35
  197. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/fetch.mdx +0 -26
  198. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/file-uploads.mdx +0 -97
  199. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/hot.mdx +0 -28
  200. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/proxy.mdx +0 -50
  201. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/server.mdx +0 -48
  202. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/simple.mdx +0 -20
  203. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/stream-file.mdx +0 -50
  204. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/stream-iterator.mdx +0 -49
  205. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/stream-node-streams-in-bun.mdx +0 -22
  206. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/tls.mdx +0 -32
  207. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/index.mdx +0 -10
  208. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-dev.mdx +0 -28
  209. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-git.mdx +0 -40
  210. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-optional.mdx +0 -27
  211. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-peer.mdx +0 -45
  212. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-tarball.mdx +0 -35
  213. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add.mdx +0 -44
  214. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/azure-artifacts.mdx +0 -76
  215. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/cicd.mdx +0 -43
  216. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/custom-registry.mdx +0 -32
  217. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/from-npm-install-to-bun-install.mdx +0 -230
  218. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/git-diff-bun-lockfile.mdx +0 -48
  219. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/jfrog-artifactory.mdx +0 -28
  220. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/npm-alias.mdx +0 -25
  221. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/registry-scope.mdx +0 -40
  222. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/trusted.mdx +0 -52
  223. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/workspaces.mdx +0 -70
  224. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/yarnlock.mdx +0 -51
  225. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/argv.mdx +0 -66
  226. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/ctrl-c.mdx +0 -18
  227. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/ipc.mdx +0 -69
  228. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/nanoseconds.mdx +0 -15
  229. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/os-signals.mdx +0 -31
  230. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/spawn-stderr.mdx +0 -34
  231. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/spawn-stdout.mdx +0 -28
  232. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/spawn.mdx +0 -43
  233. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/stdin.mdx +0 -62
  234. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/arraybuffer.mdx +0 -30
  235. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/buffer.mdx +0 -21
  236. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/exists.mdx +0 -18
  237. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/json.mdx +0 -19
  238. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/mime.mdx +0 -22
  239. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/stream.mdx +0 -28
  240. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/string.mdx +0 -24
  241. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/uint8array.mdx +0 -23
  242. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/watch.mdx +0 -66
  243. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/build-time-constants.mdx +0 -295
  244. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/cicd.mdx +0 -45
  245. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/codesign-macos-executable.mdx +0 -61
  246. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/define-constant.mdx +0 -149
  247. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/delete-directory.mdx +0 -39
  248. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/delete-file.mdx +0 -21
  249. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/heap-snapshot.mdx +0 -28
  250. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-html.mdx +0 -15
  251. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-json.mdx +0 -46
  252. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-json5.mdx +0 -74
  253. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-toml.mdx +0 -32
  254. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-yaml.mdx +0 -104
  255. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/read-env.mdx +0 -37
  256. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/set-env.mdx +0 -51
  257. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/shell.mdx +0 -42
  258. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/timezone.mdx +0 -38
  259. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/tsconfig-paths.mdx +0 -31
  260. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/typescript.mdx +0 -51
  261. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/vscode-debugger.mdx +0 -47
  262. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/web-debugger.mdx +0 -103
  263. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-arraybuffer.mdx +0 -13
  264. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-blob.mdx +0 -13
  265. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-json.mdx +0 -14
  266. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-string.mdx +0 -14
  267. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-uint8array.mdx +0 -13
  268. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-array.mdx +0 -16
  269. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-arraybuffer.mdx +0 -16
  270. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-blob.mdx +0 -16
  271. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-buffer.mdx +0 -17
  272. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-json.mdx +0 -16
  273. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-string.mdx +0 -16
  274. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-typedarray.mdx +0 -24
  275. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/bail.mdx +0 -24
  276. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/concurrent-test-glob.mdx +0 -146
  277. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/coverage-threshold.mdx +0 -67
  278. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/coverage.mdx +0 -49
  279. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/happy-dom.mdx +0 -73
  280. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/migrate-from-jest.mdx +0 -125
  281. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/mock-clock.mdx +0 -50
  282. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/mock-functions.mdx +0 -70
  283. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/rerun-each.mdx +0 -16
  284. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/run-tests.mdx +0 -116
  285. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/skip-tests.mdx +0 -43
  286. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/snapshot.mdx +0 -102
  287. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/spy-on.mdx +0 -49
  288. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/svelte-test.mdx +0 -113
  289. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/testing-library.mdx +0 -93
  290. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/timeout.mdx +0 -17
  291. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/todo-tests.mdx +0 -74
  292. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/update-snapshots.mdx +0 -49
  293. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/watch-mode.mdx +0 -24
  294. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/base64.mdx +0 -17
  295. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/deep-equals.mdx +0 -41
  296. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/deflate.mdx +0 -20
  297. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/detect-bun.mdx +0 -28
  298. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/entrypoint.mdx +0 -19
  299. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/escape-html.mdx +0 -24
  300. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/file-url-to-path.mdx +0 -16
  301. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/gzip.mdx +0 -20
  302. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/hash-a-password.mdx +0 -56
  303. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/import-meta-dir.mdx +0 -15
  304. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/import-meta-file.mdx +0 -15
  305. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/import-meta-path.mdx +0 -15
  306. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/javascript-uuid.mdx +0 -25
  307. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/main.mdx +0 -43
  308. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/path-to-file-url.mdx +0 -16
  309. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/sleep.mdx +0 -24
  310. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/upgrade.mdx +0 -93
  311. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/version.mdx +0 -23
  312. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/which-path-to-executable-bin.mdx +0 -17
  313. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/compression.mdx +0 -33
  314. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/context.mdx +0 -79
  315. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/pubsub.mdx +0 -43
  316. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/simple.mdx +0 -38
  317. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/append.mdx +0 -54
  318. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/basic.mdx +0 -46
  319. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/blob.mdx +0 -30
  320. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/cat.mdx +0 -19
  321. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/file-cp.mdx +0 -18
  322. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/filesink.mdx +0 -54
  323. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/response.mdx +0 -19
  324. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/stdout.mdx +0 -23
  325. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/stream.mdx +0 -19
  326. package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/unlink.mdx +0 -18
  327. package/connectors/connect-yousign/node_modules/bun-types/docs/index.mdx +0 -133
  328. package/connectors/connect-yousign/node_modules/bun-types/docs/installation.mdx +0 -372
  329. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/bunx.mdx +0 -91
  330. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/catalogs.mdx +0 -292
  331. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/add.mdx +0 -179
  332. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/audit.mdx +0 -60
  333. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/info.mdx +0 -70
  334. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/install.mdx +0 -591
  335. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/link.mdx +0 -61
  336. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/outdated.mdx +0 -197
  337. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/patch.mdx +0 -69
  338. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/pm.mdx +0 -323
  339. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/publish.mdx +0 -131
  340. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/remove.mdx +0 -16
  341. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/update.mdx +0 -140
  342. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/why.mdx +0 -84
  343. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/filter.mdx +0 -127
  344. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/global-cache.mdx +0 -72
  345. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/isolated-installs.mdx +0 -220
  346. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/lifecycle.mdx +0 -64
  347. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/lockfile.mdx +0 -64
  348. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/npmrc.mdx +0 -245
  349. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/overrides.mdx +0 -83
  350. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/scopes-registries.mdx +0 -35
  351. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/security-scanner-api.mdx +0 -95
  352. package/connectors/connect-yousign/node_modules/bun-types/docs/pm/workspaces.mdx +0 -115
  353. package/connectors/connect-yousign/node_modules/bun-types/docs/project/benchmarking.mdx +0 -296
  354. package/connectors/connect-yousign/node_modules/bun-types/docs/project/bindgen.mdx +0 -223
  355. package/connectors/connect-yousign/node_modules/bun-types/docs/project/building-windows.mdx +0 -143
  356. package/connectors/connect-yousign/node_modules/bun-types/docs/project/contributing.mdx +0 -366
  357. package/connectors/connect-yousign/node_modules/bun-types/docs/project/feedback.mdx +0 -20
  358. package/connectors/connect-yousign/node_modules/bun-types/docs/project/license.mdx +0 -78
  359. package/connectors/connect-yousign/node_modules/bun-types/docs/project/roadmap.mdx +0 -8
  360. package/connectors/connect-yousign/node_modules/bun-types/docs/quickstart.mdx +0 -251
  361. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/archive.mdx +0 -452
  362. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/auto-install.mdx +0 -97
  363. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/binary-data.mdx +0 -846
  364. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/bun-apis.mdx +0 -59
  365. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/bunfig.mdx +0 -754
  366. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/c-compiler.mdx +0 -204
  367. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/child-process.mdx +0 -659
  368. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/color.mdx +0 -267
  369. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/console.mdx +0 -67
  370. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/cookies.mdx +0 -454
  371. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/debugger.mdx +0 -335
  372. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/environment-variables.mdx +0 -231
  373. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/ffi.mdx +0 -567
  374. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/file-io.mdx +0 -306
  375. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/file-system-router.mdx +0 -118
  376. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/file-types.mdx +0 -482
  377. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/glob.mdx +0 -181
  378. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/globals.mdx +0 -72
  379. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/hashing.mdx +0 -315
  380. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/html-rewriter.mdx +0 -333
  381. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/cookies.mdx +0 -79
  382. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/error-handling.mdx +0 -40
  383. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/metrics.mdx +0 -36
  384. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/routing.mdx +0 -289
  385. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/server.mdx +0 -645
  386. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/tls.mdx +0 -101
  387. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/websockets.mdx +0 -414
  388. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/index.mdx +0 -223
  389. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/json5.mdx +0 -271
  390. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/jsonl.mdx +0 -188
  391. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/jsx.mdx +0 -115
  392. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/markdown.mdx +0 -344
  393. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/module-resolution.mdx +0 -374
  394. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/dns.mdx +0 -111
  395. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/fetch.mdx +0 -484
  396. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/tcp.mdx +0 -239
  397. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/udp.mdx +0 -180
  398. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/node-api.mdx +0 -19
  399. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/nodejs-compat.mdx +0 -468
  400. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/plugins.mdx +0 -419
  401. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/redis.mdx +0 -583
  402. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/repl.mdx +0 -176
  403. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/s3.mdx +0 -881
  404. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/secrets.mdx +0 -340
  405. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/semver.mdx +0 -57
  406. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/shell.mdx +0 -637
  407. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/sql.mdx +0 -1404
  408. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/sqlite.mdx +0 -721
  409. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/streams.mdx +0 -232
  410. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/templating/create.mdx +0 -269
  411. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/templating/init.mdx +0 -58
  412. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/transpiler.mdx +0 -288
  413. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/typescript.mdx +0 -58
  414. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/utils.mdx +0 -1010
  415. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/watch-mode.mdx +0 -161
  416. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/web-apis.mdx +0 -29
  417. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/workers.mdx +0 -314
  418. package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/yaml.mdx +0 -469
  419. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/add.mdx +0 -166
  420. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/build.mdx +0 -197
  421. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/bunx.mdx +0 -49
  422. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/feedback.mdx +0 -17
  423. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/init.mdx +0 -84
  424. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/install.mdx +0 -173
  425. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/link.mdx +0 -163
  426. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/outdated.mdx +0 -140
  427. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/patch.mdx +0 -171
  428. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/publish.mdx +0 -198
  429. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/remove.mdx +0 -146
  430. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/run.mdx +0 -305
  431. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/test.mdx +0 -105
  432. package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/update.mdx +0 -144
  433. package/connectors/connect-yousign/node_modules/bun-types/docs/test/code-coverage.mdx +0 -409
  434. package/connectors/connect-yousign/node_modules/bun-types/docs/test/configuration.mdx +0 -520
  435. package/connectors/connect-yousign/node_modules/bun-types/docs/test/dates-times.mdx +0 -129
  436. package/connectors/connect-yousign/node_modules/bun-types/docs/test/discovery.mdx +0 -90
  437. package/connectors/connect-yousign/node_modules/bun-types/docs/test/dom.mdx +0 -226
  438. package/connectors/connect-yousign/node_modules/bun-types/docs/test/index.mdx +0 -409
  439. package/connectors/connect-yousign/node_modules/bun-types/docs/test/lifecycle.mdx +0 -366
  440. package/connectors/connect-yousign/node_modules/bun-types/docs/test/mocks.mdx +0 -637
  441. package/connectors/connect-yousign/node_modules/bun-types/docs/test/reporters.mdx +0 -126
  442. package/connectors/connect-yousign/node_modules/bun-types/docs/test/runtime-behavior.mdx +0 -342
  443. package/connectors/connect-yousign/node_modules/bun-types/docs/test/snapshots.mdx +0 -434
  444. package/connectors/connect-yousign/node_modules/bun-types/docs/test/writing-tests.mdx +0 -672
  445. package/connectors/connect-yousign/node_modules/bun-types/docs/typescript.mdx +0 -54
  446. package/connectors/connect-yousign/node_modules/bun-types/extensions.d.ts +0 -40
  447. package/connectors/connect-yousign/node_modules/bun-types/fetch.d.ts +0 -79
  448. package/connectors/connect-yousign/node_modules/bun-types/ffi.d.ts +0 -1154
  449. package/connectors/connect-yousign/node_modules/bun-types/globals.d.ts +0 -2067
  450. package/connectors/connect-yousign/node_modules/bun-types/html-rewriter.d.ts +0 -186
  451. package/connectors/connect-yousign/node_modules/bun-types/index.d.ts +0 -32
  452. package/connectors/connect-yousign/node_modules/bun-types/jsc.d.ts +0 -233
  453. package/connectors/connect-yousign/node_modules/bun-types/jsx.d.ts +0 -11
  454. package/connectors/connect-yousign/node_modules/bun-types/overrides.d.ts +0 -376
  455. package/connectors/connect-yousign/node_modules/bun-types/package.json +0 -37
  456. package/connectors/connect-yousign/node_modules/bun-types/redis.d.ts +0 -3352
  457. package/connectors/connect-yousign/node_modules/bun-types/s3.d.ts +0 -1335
  458. package/connectors/connect-yousign/node_modules/bun-types/security.d.ts +0 -101
  459. package/connectors/connect-yousign/node_modules/bun-types/serve.d.ts +0 -1296
  460. package/connectors/connect-yousign/node_modules/bun-types/shell.d.ts +0 -380
  461. package/connectors/connect-yousign/node_modules/bun-types/sql.d.ts +0 -887
  462. package/connectors/connect-yousign/node_modules/bun-types/sqlite.d.ts +0 -1322
  463. package/connectors/connect-yousign/node_modules/bun-types/test-globals.d.ts +0 -22
  464. package/connectors/connect-yousign/node_modules/bun-types/test.d.ts +0 -2392
  465. package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/branding.d.ts +0 -283
  466. package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/index.d.ts +0 -1207
  467. package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/messages.d.ts +0 -395
  468. package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/overloads.d.ts +0 -669
  469. package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/utils.d.ts +0 -431
  470. package/connectors/connect-yousign/node_modules/bun-types/wasm.d.ts +0 -193
  471. package/connectors/connect-yousign/node_modules/chalk/license +0 -9
  472. package/connectors/connect-yousign/node_modules/chalk/package.json +0 -83
  473. package/connectors/connect-yousign/node_modules/chalk/readme.md +0 -297
  474. package/connectors/connect-yousign/node_modules/chalk/source/index.d.ts +0 -325
  475. package/connectors/connect-yousign/node_modules/chalk/source/index.js +0 -225
  476. package/connectors/connect-yousign/node_modules/chalk/source/utilities.js +0 -33
  477. package/connectors/connect-yousign/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
  478. package/connectors/connect-yousign/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
  479. package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  480. package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/browser.js +0 -34
  481. package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  482. package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/index.js +0 -190
  483. package/connectors/connect-yousign/node_modules/commander/LICENSE +0 -22
  484. package/connectors/connect-yousign/node_modules/commander/Readme.md +0 -1157
  485. package/connectors/connect-yousign/node_modules/commander/esm.mjs +0 -16
  486. package/connectors/connect-yousign/node_modules/commander/index.js +0 -24
  487. package/connectors/connect-yousign/node_modules/commander/lib/argument.js +0 -149
  488. package/connectors/connect-yousign/node_modules/commander/lib/command.js +0 -2509
  489. package/connectors/connect-yousign/node_modules/commander/lib/error.js +0 -39
  490. package/connectors/connect-yousign/node_modules/commander/lib/help.js +0 -520
  491. package/connectors/connect-yousign/node_modules/commander/lib/option.js +0 -330
  492. package/connectors/connect-yousign/node_modules/commander/lib/suggestSimilar.js +0 -101
  493. package/connectors/connect-yousign/node_modules/commander/package-support.json +0 -16
  494. package/connectors/connect-yousign/node_modules/commander/package.json +0 -84
  495. package/connectors/connect-yousign/node_modules/commander/typings/esm.d.mts +0 -3
  496. package/connectors/connect-yousign/node_modules/commander/typings/index.d.ts +0 -969
  497. package/connectors/connect-yousign/node_modules/typescript/LICENSE.txt +0 -55
  498. package/connectors/connect-yousign/node_modules/typescript/README.md +0 -50
  499. package/connectors/connect-yousign/node_modules/typescript/SECURITY.md +0 -41
  500. package/connectors/connect-yousign/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  501. package/connectors/connect-yousign/node_modules/typescript/bin/tsc +0 -2
  502. package/connectors/connect-yousign/node_modules/typescript/bin/tsserver +0 -2
  503. package/connectors/connect-yousign/node_modules/typescript/lib/_tsc.js +0 -133818
  504. package/connectors/connect-yousign/node_modules/typescript/lib/_tsserver.js +0 -659
  505. package/connectors/connect-yousign/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  506. package/connectors/connect-yousign/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  507. package/connectors/connect-yousign/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  508. package/connectors/connect-yousign/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  509. package/connectors/connect-yousign/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  510. package/connectors/connect-yousign/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  511. package/connectors/connect-yousign/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  512. package/connectors/connect-yousign/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  513. package/connectors/connect-yousign/node_modules/typescript/lib/lib.d.ts +0 -22
  514. package/connectors/connect-yousign/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  515. package/connectors/connect-yousign/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  516. package/connectors/connect-yousign/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  517. package/connectors/connect-yousign/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  518. package/connectors/connect-yousign/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  519. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  520. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  521. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  522. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  523. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  524. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  525. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  526. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  527. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  528. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  529. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  530. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  531. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  532. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  533. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  534. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  535. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  536. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  537. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  538. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  539. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  540. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  541. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  542. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  543. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  544. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  545. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  546. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  547. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  548. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  549. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  550. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  551. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  552. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  553. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  554. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  555. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  556. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  557. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  558. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  559. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  560. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  561. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  562. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  563. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  564. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  565. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  566. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  567. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  568. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  569. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  570. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  571. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  572. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  573. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  574. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  575. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  576. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  577. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  578. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  579. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  580. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  581. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  582. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  583. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  584. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  585. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  586. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  587. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  588. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  589. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  590. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  591. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  592. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  593. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  594. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  595. package/connectors/connect-yousign/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  596. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  597. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  598. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  599. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  600. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  601. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  602. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  603. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  604. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  605. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  606. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  607. package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  608. package/connectors/connect-yousign/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  609. package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  610. package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  611. package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  612. package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  613. package/connectors/connect-yousign/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  614. package/connectors/connect-yousign/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  615. package/connectors/connect-yousign/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  616. package/connectors/connect-yousign/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  617. package/connectors/connect-yousign/node_modules/typescript/lib/tsc.js +0 -8
  618. package/connectors/connect-yousign/node_modules/typescript/lib/tsserver.js +0 -8
  619. package/connectors/connect-yousign/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  620. package/connectors/connect-yousign/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  621. package/connectors/connect-yousign/node_modules/typescript/lib/typesMap.json +0 -497
  622. package/connectors/connect-yousign/node_modules/typescript/lib/typescript.d.ts +0 -11437
  623. package/connectors/connect-yousign/node_modules/typescript/lib/typescript.js +0 -200276
  624. package/connectors/connect-yousign/node_modules/typescript/lib/typingsInstaller.js +0 -8
  625. package/connectors/connect-yousign/node_modules/typescript/lib/watchGuard.js +0 -53
  626. package/connectors/connect-yousign/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  627. package/connectors/connect-yousign/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  628. package/connectors/connect-yousign/node_modules/typescript/package.json +0 -120
  629. package/connectors/connect-yousign/node_modules/undici-types/LICENSE +0 -21
  630. package/connectors/connect-yousign/node_modules/undici-types/README.md +0 -6
  631. package/connectors/connect-yousign/node_modules/undici-types/agent.d.ts +0 -32
  632. package/connectors/connect-yousign/node_modules/undici-types/api.d.ts +0 -43
  633. package/connectors/connect-yousign/node_modules/undici-types/balanced-pool.d.ts +0 -30
  634. package/connectors/connect-yousign/node_modules/undici-types/cache-interceptor.d.ts +0 -173
  635. package/connectors/connect-yousign/node_modules/undici-types/cache.d.ts +0 -36
  636. package/connectors/connect-yousign/node_modules/undici-types/client-stats.d.ts +0 -15
  637. package/connectors/connect-yousign/node_modules/undici-types/client.d.ts +0 -108
  638. package/connectors/connect-yousign/node_modules/undici-types/connector.d.ts +0 -34
  639. package/connectors/connect-yousign/node_modules/undici-types/content-type.d.ts +0 -21
  640. package/connectors/connect-yousign/node_modules/undici-types/cookies.d.ts +0 -30
  641. package/connectors/connect-yousign/node_modules/undici-types/diagnostics-channel.d.ts +0 -74
  642. package/connectors/connect-yousign/node_modules/undici-types/dispatcher.d.ts +0 -276
  643. package/connectors/connect-yousign/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -22
  644. package/connectors/connect-yousign/node_modules/undici-types/errors.d.ts +0 -161
  645. package/connectors/connect-yousign/node_modules/undici-types/eventsource.d.ts +0 -66
  646. package/connectors/connect-yousign/node_modules/undici-types/fetch.d.ts +0 -211
  647. package/connectors/connect-yousign/node_modules/undici-types/formdata.d.ts +0 -108
  648. package/connectors/connect-yousign/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  649. package/connectors/connect-yousign/node_modules/undici-types/global-origin.d.ts +0 -7
  650. package/connectors/connect-yousign/node_modules/undici-types/h2c-client.d.ts +0 -73
  651. package/connectors/connect-yousign/node_modules/undici-types/handlers.d.ts +0 -15
  652. package/connectors/connect-yousign/node_modules/undici-types/header.d.ts +0 -160
  653. package/connectors/connect-yousign/node_modules/undici-types/index.d.ts +0 -88
  654. package/connectors/connect-yousign/node_modules/undici-types/interceptors.d.ts +0 -73
  655. package/connectors/connect-yousign/node_modules/undici-types/mock-agent.d.ts +0 -68
  656. package/connectors/connect-yousign/node_modules/undici-types/mock-call-history.d.ts +0 -111
  657. package/connectors/connect-yousign/node_modules/undici-types/mock-client.d.ts +0 -27
  658. package/connectors/connect-yousign/node_modules/undici-types/mock-errors.d.ts +0 -12
  659. package/connectors/connect-yousign/node_modules/undici-types/mock-interceptor.d.ts +0 -94
  660. package/connectors/connect-yousign/node_modules/undici-types/mock-pool.d.ts +0 -27
  661. package/connectors/connect-yousign/node_modules/undici-types/package.json +0 -55
  662. package/connectors/connect-yousign/node_modules/undici-types/patch.d.ts +0 -29
  663. package/connectors/connect-yousign/node_modules/undici-types/pool-stats.d.ts +0 -19
  664. package/connectors/connect-yousign/node_modules/undici-types/pool.d.ts +0 -41
  665. package/connectors/connect-yousign/node_modules/undici-types/proxy-agent.d.ts +0 -29
  666. package/connectors/connect-yousign/node_modules/undici-types/readable.d.ts +0 -68
  667. package/connectors/connect-yousign/node_modules/undici-types/retry-agent.d.ts +0 -8
  668. package/connectors/connect-yousign/node_modules/undici-types/retry-handler.d.ts +0 -125
  669. package/connectors/connect-yousign/node_modules/undici-types/round-robin-pool.d.ts +0 -41
  670. package/connectors/connect-yousign/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  671. package/connectors/connect-yousign/node_modules/undici-types/util.d.ts +0 -18
  672. package/connectors/connect-yousign/node_modules/undici-types/utility.d.ts +0 -7
  673. package/connectors/connect-yousign/node_modules/undici-types/webidl.d.ts +0 -341
  674. package/connectors/connect-yousign/node_modules/undici-types/websocket.d.ts +0 -186
  675. package/dashboard/dist/assets/index-CSlS3oNV.css +0 -1
  676. package/dashboard/dist/assets/index-sSIkMXYs.js +0 -284
@@ -1,2275 +0,0 @@
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/v25.x/lib/test.js)
80
- */
81
- declare module "node:test" {
82
- import { AssertMethodNames } from "node:assert";
83
- import { Readable, ReadableEventMap } from "node:stream";
84
- import { TestEvent } from "node:test/reporters";
85
- import { URL } from "node:url";
86
- import TestFn = test.TestFn;
87
- import TestOptions = test.TestOptions;
88
- /**
89
- * The `test()` function is the value imported from the `test` module. Each
90
- * invocation of this function results in reporting the test to the `TestsStream`.
91
- *
92
- * The `TestContext` object passed to the `fn` argument can be used to perform
93
- * actions related to the current test. Examples include skipping the test, adding
94
- * additional diagnostic information, or creating subtests.
95
- *
96
- * `test()` returns a `Promise` that fulfills once the test completes.
97
- * if `test()` is called within a suite, it fulfills immediately.
98
- * The return value can usually be discarded for top level tests.
99
- * However, the return value from subtests should be used to prevent the parent
100
- * test from finishing first and cancelling the subtest
101
- * as shown in the following example.
102
- *
103
- * ```js
104
- * test('top level test', async (t) => {
105
- * // The setTimeout() in the following subtest would cause it to outlive its
106
- * // parent test if 'await' is removed on the next line. Once the parent test
107
- * // completes, it will cancel any outstanding subtests.
108
- * await t.test('longer running subtest', async (t) => {
109
- * return new Promise((resolve, reject) => {
110
- * setTimeout(resolve, 1000);
111
- * });
112
- * });
113
- * });
114
- * ```
115
- *
116
- * The `timeout` option can be used to fail the test if it takes longer than `timeout` milliseconds to complete. However, it is not a reliable mechanism for
117
- * canceling tests because a running test might block the application thread and
118
- * thus prevent the scheduled cancellation.
119
- * @since v18.0.0, v16.17.0
120
- * @param name The name of the test, which is displayed when reporting test results.
121
- * Defaults to the `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.
122
- * @param options Configuration options for the test.
123
- * @param fn The function under test. The first argument to this function is a {@link TestContext} object.
124
- * If the test uses callbacks, the callback function is passed as the second argument.
125
- * @return Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite.
126
- */
127
- function test(name?: string, fn?: TestFn): Promise<void>;
128
- function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
129
- function test(options?: TestOptions, fn?: TestFn): Promise<void>;
130
- function test(fn?: TestFn): Promise<void>;
131
- namespace test {
132
- export { test };
133
- export { suite as describe, test as it };
134
- }
135
- namespace test {
136
- /**
137
- * **Note:** `shard` is used to horizontally parallelize test running across
138
- * machines or processes, ideal for large-scale executions across varied
139
- * environments. It's incompatible with `watch` mode, tailored for rapid
140
- * code iteration by automatically rerunning tests on file changes.
141
- *
142
- * ```js
143
- * import { tap } from 'node:test/reporters';
144
- * import { run } from 'node:test';
145
- * import process from 'node:process';
146
- * import path from 'node:path';
147
- *
148
- * run({ files: [path.resolve('./tests/test.js')] })
149
- * .compose(tap)
150
- * .pipe(process.stdout);
151
- * ```
152
- * @since v18.9.0, v16.19.0
153
- * @param options Configuration options for running tests.
154
- */
155
- function run(options?: RunOptions): TestsStream;
156
- /**
157
- * The `suite()` function is imported from the `node:test` module.
158
- * @param name The name of the suite, which is displayed when reporting test results.
159
- * Defaults to the `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.
160
- * @param options Configuration options for the suite. This supports the same options as {@link test}.
161
- * @param fn The suite function declaring nested tests and suites. The first argument to this function is a {@link SuiteContext} object.
162
- * @return Immediately fulfilled with `undefined`.
163
- * @since v20.13.0
164
- */
165
- function suite(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
166
- function suite(name?: string, fn?: SuiteFn): Promise<void>;
167
- function suite(options?: TestOptions, fn?: SuiteFn): Promise<void>;
168
- function suite(fn?: SuiteFn): Promise<void>;
169
- namespace suite {
170
- /**
171
- * Shorthand for skipping a suite. This is the same as calling {@link suite} with `options.skip` set to `true`.
172
- * @since v20.13.0
173
- */
174
- function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
175
- function skip(name?: string, fn?: SuiteFn): Promise<void>;
176
- function skip(options?: TestOptions, fn?: SuiteFn): Promise<void>;
177
- function skip(fn?: SuiteFn): Promise<void>;
178
- /**
179
- * Shorthand for marking a suite as `TODO`. This is the same as calling {@link suite} with `options.todo` set to `true`.
180
- * @since v20.13.0
181
- */
182
- function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
183
- function todo(name?: string, fn?: SuiteFn): Promise<void>;
184
- function todo(options?: TestOptions, fn?: SuiteFn): Promise<void>;
185
- function todo(fn?: SuiteFn): Promise<void>;
186
- /**
187
- * Shorthand for marking a suite as `only`. This is the same as calling {@link suite} with `options.only` set to `true`.
188
- * @since v20.13.0
189
- */
190
- function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
191
- function only(name?: string, fn?: SuiteFn): Promise<void>;
192
- function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
193
- function only(fn?: SuiteFn): Promise<void>;
194
- // added in v25.5.0, undocumented
195
- function expectFailure(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
196
- function expectFailure(name?: string, fn?: SuiteFn): Promise<void>;
197
- function expectFailure(options?: TestOptions, fn?: SuiteFn): Promise<void>;
198
- function expectFailure(fn?: SuiteFn): Promise<void>;
199
- }
200
- /**
201
- * Shorthand for skipping a test. This is the same as calling {@link test} with `options.skip` set to `true`.
202
- * @since v20.2.0
203
- */
204
- function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
205
- function skip(name?: string, fn?: TestFn): Promise<void>;
206
- function skip(options?: TestOptions, fn?: TestFn): Promise<void>;
207
- function skip(fn?: TestFn): Promise<void>;
208
- /**
209
- * Shorthand for marking a test as `TODO`. This is the same as calling {@link test} with `options.todo` set to `true`.
210
- * @since v20.2.0
211
- */
212
- function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
213
- function todo(name?: string, fn?: TestFn): Promise<void>;
214
- function todo(options?: TestOptions, fn?: TestFn): Promise<void>;
215
- function todo(fn?: TestFn): Promise<void>;
216
- /**
217
- * Shorthand for marking a test as `only`. This is the same as calling {@link test} with `options.only` set to `true`.
218
- * @since v20.2.0
219
- */
220
- function only(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
221
- function only(name?: string, fn?: TestFn): Promise<void>;
222
- function only(options?: TestOptions, fn?: TestFn): Promise<void>;
223
- function only(fn?: TestFn): Promise<void>;
224
- // added in v25.5.0, undocumented
225
- function expectFailure(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
226
- function expectFailure(name?: string, fn?: TestFn): Promise<void>;
227
- function expectFailure(options?: TestOptions, fn?: TestFn): Promise<void>;
228
- function expectFailure(fn?: TestFn): Promise<void>;
229
- /**
230
- * The type of a function passed to {@link test}. The first argument to this function is a {@link TestContext} object.
231
- * If the test uses callbacks, the callback function is passed as the second argument.
232
- */
233
- type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise<void>;
234
- /**
235
- * The type of a suite test function. The argument to this function is a {@link SuiteContext} object.
236
- */
237
- type SuiteFn = (s: SuiteContext) => void | Promise<void>;
238
- interface TestShard {
239
- /**
240
- * A positive integer between 1 and `total` that specifies the index of the shard to run.
241
- */
242
- index: number;
243
- /**
244
- * A positive integer that specifies the total number of shards to split the test files to.
245
- */
246
- total: number;
247
- }
248
- interface RunOptions {
249
- /**
250
- * If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop).
251
- * If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time.
252
- * @default false
253
- */
254
- concurrency?: number | boolean | undefined;
255
- /**
256
- * Specifies the current working directory to be used by the test runner.
257
- * Serves as the base path for resolving files according to the
258
- * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model).
259
- * @since v23.0.0
260
- * @default process.cwd()
261
- */
262
- cwd?: string | undefined;
263
- /**
264
- * An array containing the list of files to run. If omitted, files are run according to the
265
- * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model).
266
- */
267
- files?: readonly string[] | undefined;
268
- /**
269
- * Configures the test runner to exit the process once all known
270
- * tests have finished executing even if the event loop would
271
- * otherwise remain active.
272
- * @default false
273
- */
274
- forceExit?: boolean | undefined;
275
- /**
276
- * An array containing the list of glob patterns to match test files.
277
- * This option cannot be used together with `files`. If omitted, files are run according to the
278
- * [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model).
279
- * @since v22.6.0
280
- */
281
- globPatterns?: readonly string[] | undefined;
282
- /**
283
- * Sets inspector port of test child process.
284
- * This can be a number, or a function that takes no arguments and returns a
285
- * number. If a nullish value is provided, each process gets its own port,
286
- * incremented from the primary's `process.debugPort`. This option is ignored
287
- * if the `isolation` option is set to `'none'` as no child processes are
288
- * spawned.
289
- * @default undefined
290
- */
291
- inspectPort?: number | (() => number) | undefined;
292
- /**
293
- * Configures the type of test isolation. If set to
294
- * `'process'`, each test file is run in a separate child process. If set to
295
- * `'none'`, all test files run in the current process.
296
- * @default 'process'
297
- * @since v22.8.0
298
- */
299
- isolation?: "process" | "none" | undefined;
300
- /**
301
- * If truthy, the test context will only run tests that have the `only` option set
302
- */
303
- only?: boolean | undefined;
304
- /**
305
- * A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run.
306
- * @default undefined
307
- */
308
- setup?: ((reporter: TestsStream) => void | Promise<void>) | undefined;
309
- /**
310
- * An array of CLI flags to pass to the `node` executable when
311
- * spawning the subprocesses. This option has no effect when `isolation` is `'none`'.
312
- * @since v22.10.0
313
- * @default []
314
- */
315
- execArgv?: readonly string[] | undefined;
316
- /**
317
- * An array of CLI flags to pass to each test file when spawning the
318
- * subprocesses. This option has no effect when `isolation` is `'none'`.
319
- * @since v22.10.0
320
- * @default []
321
- */
322
- argv?: readonly string[] | undefined;
323
- /**
324
- * Allows aborting an in-progress test execution.
325
- */
326
- signal?: AbortSignal | undefined;
327
- /**
328
- * If provided, only run tests whose name matches the provided pattern.
329
- * Strings are interpreted as JavaScript regular expressions.
330
- * @default undefined
331
- */
332
- testNamePatterns?: string | RegExp | ReadonlyArray<string | RegExp> | undefined;
333
- /**
334
- * A String, RegExp or a RegExp Array, that can be used to exclude running tests whose
335
- * name matches the provided pattern. Test name patterns are interpreted as JavaScript
336
- * regular expressions. For each test that is executed, any corresponding test hooks,
337
- * such as `beforeEach()`, are also run.
338
- * @default undefined
339
- * @since v22.1.0
340
- */
341
- testSkipPatterns?: string | RegExp | ReadonlyArray<string | RegExp> | undefined;
342
- /**
343
- * The number of milliseconds after which the test execution will fail.
344
- * If unspecified, subtests inherit this value from their parent.
345
- * @default Infinity
346
- */
347
- timeout?: number | undefined;
348
- /**
349
- * Whether to run in watch mode or not.
350
- * @default false
351
- */
352
- watch?: boolean | undefined;
353
- /**
354
- * Running tests in a specific shard.
355
- * @default undefined
356
- */
357
- shard?: TestShard | undefined;
358
- /**
359
- * A file path where the test runner will
360
- * store the state of the tests to allow rerunning only the failed tests on a next run.
361
- * @since v24.7.0
362
- * @default undefined
363
- */
364
- rerunFailuresFilePath?: string | undefined;
365
- /**
366
- * enable [code coverage](https://nodejs.org/docs/latest-v25.x/api/test.html#collecting-code-coverage) collection.
367
- * @since v22.10.0
368
- * @default false
369
- */
370
- coverage?: boolean | undefined;
371
- /**
372
- * Excludes specific files from code coverage
373
- * using a glob pattern, which can match both absolute and relative file paths.
374
- * This property is only applicable when `coverage` was set to `true`.
375
- * If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided,
376
- * files must meet **both** criteria to be included in the coverage report.
377
- * @since v22.10.0
378
- * @default undefined
379
- */
380
- coverageExcludeGlobs?: string | readonly string[] | undefined;
381
- /**
382
- * Includes specific files in code coverage
383
- * using a glob pattern, which can match both absolute and relative file paths.
384
- * This property is only applicable when `coverage` was set to `true`.
385
- * If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided,
386
- * files must meet **both** criteria to be included in the coverage report.
387
- * @since v22.10.0
388
- * @default undefined
389
- */
390
- coverageIncludeGlobs?: string | readonly string[] | undefined;
391
- /**
392
- * Require a minimum percent of covered lines. If code
393
- * coverage does not reach the threshold specified, the process will exit with code `1`.
394
- * @since v22.10.0
395
- * @default 0
396
- */
397
- lineCoverage?: number | undefined;
398
- /**
399
- * Require a minimum percent of covered branches. If code
400
- * coverage does not reach the threshold specified, the process will exit with code `1`.
401
- * @since v22.10.0
402
- * @default 0
403
- */
404
- branchCoverage?: number | undefined;
405
- /**
406
- * Require a minimum percent of covered functions. If code
407
- * coverage does not reach the threshold specified, the process will exit with code `1`.
408
- * @since v22.10.0
409
- * @default 0
410
- */
411
- functionCoverage?: number | undefined;
412
- }
413
- interface TestsStreamEventMap extends ReadableEventMap {
414
- "data": [data: TestEvent];
415
- "test:coverage": [data: EventData.TestCoverage];
416
- "test:complete": [data: EventData.TestComplete];
417
- "test:dequeue": [data: EventData.TestDequeue];
418
- "test:diagnostic": [data: EventData.TestDiagnostic];
419
- "test:enqueue": [data: EventData.TestEnqueue];
420
- "test:fail": [data: EventData.TestFail];
421
- "test:pass": [data: EventData.TestPass];
422
- "test:plan": [data: EventData.TestPlan];
423
- "test:start": [data: EventData.TestStart];
424
- "test:stderr": [data: EventData.TestStderr];
425
- "test:stdout": [data: EventData.TestStdout];
426
- "test:summary": [data: EventData.TestSummary];
427
- "test:watch:drained": [];
428
- "test:watch:restarted": [];
429
- }
430
- /**
431
- * A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.
432
- *
433
- * Some of the events are guaranteed to be emitted in the same order as the tests are defined, while others are emitted in the order that the tests execute.
434
- * @since v18.9.0, v16.19.0
435
- */
436
- interface TestsStream extends Readable {
437
- // #region InternalEventEmitter
438
- addListener<E extends keyof TestsStreamEventMap>(
439
- eventName: E,
440
- listener: (...args: TestsStreamEventMap[E]) => void,
441
- ): this;
442
- addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
443
- emit<E extends keyof TestsStreamEventMap>(eventName: E, ...args: TestsStreamEventMap[E]): boolean;
444
- emit(eventName: string | symbol, ...args: any[]): boolean;
445
- listenerCount<E extends keyof TestsStreamEventMap>(
446
- eventName: E,
447
- listener?: (...args: TestsStreamEventMap[E]) => void,
448
- ): number;
449
- listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
450
- listeners<E extends keyof TestsStreamEventMap>(eventName: E): ((...args: TestsStreamEventMap[E]) => void)[];
451
- listeners(eventName: string | symbol): ((...args: any[]) => void)[];
452
- off<E extends keyof TestsStreamEventMap>(
453
- eventName: E,
454
- listener: (...args: TestsStreamEventMap[E]) => void,
455
- ): this;
456
- off(eventName: string | symbol, listener: (...args: any[]) => void): this;
457
- on<E extends keyof TestsStreamEventMap>(
458
- eventName: E,
459
- listener: (...args: TestsStreamEventMap[E]) => void,
460
- ): this;
461
- on(eventName: string | symbol, listener: (...args: any[]) => void): this;
462
- once<E extends keyof TestsStreamEventMap>(
463
- eventName: E,
464
- listener: (...args: TestsStreamEventMap[E]) => void,
465
- ): this;
466
- once(eventName: string | symbol, listener: (...args: any[]) => void): this;
467
- prependListener<E extends keyof TestsStreamEventMap>(
468
- eventName: E,
469
- listener: (...args: TestsStreamEventMap[E]) => void,
470
- ): this;
471
- prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
472
- prependOnceListener<E extends keyof TestsStreamEventMap>(
473
- eventName: E,
474
- listener: (...args: TestsStreamEventMap[E]) => void,
475
- ): this;
476
- prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
477
- rawListeners<E extends keyof TestsStreamEventMap>(
478
- eventName: E,
479
- ): ((...args: TestsStreamEventMap[E]) => void)[];
480
- rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
481
- // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
482
- removeAllListeners<E extends keyof TestsStreamEventMap>(eventName?: E): this;
483
- removeAllListeners(eventName?: string | symbol): this;
484
- removeListener<E extends keyof TestsStreamEventMap>(
485
- eventName: E,
486
- listener: (...args: TestsStreamEventMap[E]) => void,
487
- ): this;
488
- removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
489
- // #endregion
490
- }
491
- namespace EventData {
492
- interface Error extends globalThis.Error {
493
- cause: unknown;
494
- }
495
- interface LocationInfo {
496
- /**
497
- * The column number where the test is defined, or
498
- * `undefined` if the test was run through the REPL.
499
- */
500
- column?: number;
501
- /**
502
- * The path of the test file, `undefined` if test was run through the REPL.
503
- */
504
- file?: string;
505
- /**
506
- * The line number where the test is defined, or `undefined` if the test was run through the REPL.
507
- */
508
- line?: number;
509
- }
510
- interface TestDiagnostic extends LocationInfo {
511
- /**
512
- * The diagnostic message.
513
- */
514
- message: string;
515
- /**
516
- * The nesting level of the test.
517
- */
518
- nesting: number;
519
- /**
520
- * The severity level of the diagnostic message.
521
- * Possible values are:
522
- * * `'info'`: Informational messages.
523
- * * `'warn'`: Warnings.
524
- * * `'error'`: Errors.
525
- */
526
- level: "info" | "warn" | "error";
527
- }
528
- interface TestCoverage {
529
- /**
530
- * An object containing the coverage report.
531
- */
532
- summary: {
533
- /**
534
- * An array of coverage reports for individual files.
535
- */
536
- files: Array<{
537
- /**
538
- * The absolute path of the file.
539
- */
540
- path: string;
541
- /**
542
- * The total number of lines.
543
- */
544
- totalLineCount: number;
545
- /**
546
- * The total number of branches.
547
- */
548
- totalBranchCount: number;
549
- /**
550
- * The total number of functions.
551
- */
552
- totalFunctionCount: number;
553
- /**
554
- * The number of covered lines.
555
- */
556
- coveredLineCount: number;
557
- /**
558
- * The number of covered branches.
559
- */
560
- coveredBranchCount: number;
561
- /**
562
- * The number of covered functions.
563
- */
564
- coveredFunctionCount: number;
565
- /**
566
- * The percentage of lines covered.
567
- */
568
- coveredLinePercent: number;
569
- /**
570
- * The percentage of branches covered.
571
- */
572
- coveredBranchPercent: number;
573
- /**
574
- * The percentage of functions covered.
575
- */
576
- coveredFunctionPercent: number;
577
- /**
578
- * An array of functions representing function coverage.
579
- */
580
- functions: Array<{
581
- /**
582
- * The name of the function.
583
- */
584
- name: string;
585
- /**
586
- * The line number where the function is defined.
587
- */
588
- line: number;
589
- /**
590
- * The number of times the function was called.
591
- */
592
- count: number;
593
- }>;
594
- /**
595
- * An array of branches representing branch coverage.
596
- */
597
- branches: Array<{
598
- /**
599
- * The line number where the branch is defined.
600
- */
601
- line: number;
602
- /**
603
- * The number of times the branch was taken.
604
- */
605
- count: number;
606
- }>;
607
- /**
608
- * An array of lines representing line numbers and the number of times they were covered.
609
- */
610
- lines: Array<{
611
- /**
612
- * The line number.
613
- */
614
- line: number;
615
- /**
616
- * The number of times the line was covered.
617
- */
618
- count: number;
619
- }>;
620
- }>;
621
- /**
622
- * An object containing whether or not the coverage for
623
- * each coverage type.
624
- * @since v22.9.0
625
- */
626
- thresholds: {
627
- /**
628
- * The function coverage threshold.
629
- */
630
- function: number;
631
- /**
632
- * The branch coverage threshold.
633
- */
634
- branch: number;
635
- /**
636
- * The line coverage threshold.
637
- */
638
- line: number;
639
- };
640
- /**
641
- * An object containing a summary of coverage for all files.
642
- */
643
- totals: {
644
- /**
645
- * The total number of lines.
646
- */
647
- totalLineCount: number;
648
- /**
649
- * The total number of branches.
650
- */
651
- totalBranchCount: number;
652
- /**
653
- * The total number of functions.
654
- */
655
- totalFunctionCount: number;
656
- /**
657
- * The number of covered lines.
658
- */
659
- coveredLineCount: number;
660
- /**
661
- * The number of covered branches.
662
- */
663
- coveredBranchCount: number;
664
- /**
665
- * The number of covered functions.
666
- */
667
- coveredFunctionCount: number;
668
- /**
669
- * The percentage of lines covered.
670
- */
671
- coveredLinePercent: number;
672
- /**
673
- * The percentage of branches covered.
674
- */
675
- coveredBranchPercent: number;
676
- /**
677
- * The percentage of functions covered.
678
- */
679
- coveredFunctionPercent: number;
680
- };
681
- /**
682
- * The working directory when code coverage began. This
683
- * is useful for displaying relative path names in case
684
- * the tests changed the working directory of the Node.js process.
685
- */
686
- workingDirectory: string;
687
- };
688
- /**
689
- * The nesting level of the test.
690
- */
691
- nesting: number;
692
- }
693
- interface TestComplete extends LocationInfo {
694
- /**
695
- * Additional execution metadata.
696
- */
697
- details: {
698
- /**
699
- * Whether the test passed or not.
700
- */
701
- passed: boolean;
702
- /**
703
- * The duration of the test in milliseconds.
704
- */
705
- duration_ms: number;
706
- /**
707
- * An error wrapping the error thrown by the test if it did not pass.
708
- */
709
- error?: Error;
710
- /**
711
- * The type of the test, used to denote whether this is a suite.
712
- */
713
- type?: "suite" | "test";
714
- };
715
- /**
716
- * The test name.
717
- */
718
- name: string;
719
- /**
720
- * The nesting level of the test.
721
- */
722
- nesting: number;
723
- /**
724
- * The ordinal number of the test.
725
- */
726
- testNumber: number;
727
- /**
728
- * Present if `context.todo` is called.
729
- */
730
- todo?: string | boolean;
731
- /**
732
- * Present if `context.skip` is called.
733
- */
734
- skip?: string | boolean;
735
- }
736
- interface TestDequeue extends LocationInfo {
737
- /**
738
- * The test name.
739
- */
740
- name: string;
741
- /**
742
- * The nesting level of the test.
743
- */
744
- nesting: number;
745
- /**
746
- * The test type. Either `'suite'` or `'test'`.
747
- * @since v22.15.0
748
- */
749
- type: "suite" | "test";
750
- }
751
- interface TestEnqueue extends LocationInfo {
752
- /**
753
- * The test name.
754
- */
755
- name: string;
756
- /**
757
- * The nesting level of the test.
758
- */
759
- nesting: number;
760
- /**
761
- * The test type. Either `'suite'` or `'test'`.
762
- * @since v22.15.0
763
- */
764
- type: "suite" | "test";
765
- }
766
- interface TestFail extends LocationInfo {
767
- /**
768
- * Additional execution metadata.
769
- */
770
- details: {
771
- /**
772
- * The duration of the test in milliseconds.
773
- */
774
- duration_ms: number;
775
- /**
776
- * An error wrapping the error thrown by the test.
777
- */
778
- error: Error;
779
- /**
780
- * The type of the test, used to denote whether this is a suite.
781
- * @since v20.0.0, v19.9.0, v18.17.0
782
- */
783
- type?: "suite" | "test";
784
- /**
785
- * The attempt number of the test run,
786
- * present only when using the `--test-rerun-failures` flag.
787
- * @since v24.7.0
788
- */
789
- attempt?: number;
790
- };
791
- /**
792
- * The test name.
793
- */
794
- name: string;
795
- /**
796
- * The nesting level of the test.
797
- */
798
- nesting: number;
799
- /**
800
- * The ordinal number of the test.
801
- */
802
- testNumber: number;
803
- /**
804
- * Present if `context.todo` is called.
805
- */
806
- todo?: string | boolean;
807
- /**
808
- * Present if `context.skip` is called.
809
- */
810
- skip?: string | boolean;
811
- }
812
- interface TestPass extends LocationInfo {
813
- /**
814
- * Additional execution metadata.
815
- */
816
- details: {
817
- /**
818
- * The duration of the test in milliseconds.
819
- */
820
- duration_ms: number;
821
- /**
822
- * The type of the test, used to denote whether this is a suite.
823
- * @since 20.0.0, 19.9.0, 18.17.0
824
- */
825
- type?: "suite" | "test";
826
- /**
827
- * The attempt number of the test run,
828
- * present only when using the `--test-rerun-failures` flag.
829
- * @since v24.7.0
830
- */
831
- attempt?: number;
832
- /**
833
- * The attempt number the test passed on,
834
- * present only when using the `--test-rerun-failures` flag.
835
- * @since v24.7.0
836
- */
837
- passed_on_attempt?: number;
838
- };
839
- /**
840
- * The test name.
841
- */
842
- name: string;
843
- /**
844
- * The nesting level of the test.
845
- */
846
- nesting: number;
847
- /**
848
- * The ordinal number of the test.
849
- */
850
- testNumber: number;
851
- /**
852
- * Present if `context.todo` is called.
853
- */
854
- todo?: string | boolean;
855
- /**
856
- * Present if `context.skip` is called.
857
- */
858
- skip?: string | boolean;
859
- }
860
- interface TestPlan extends LocationInfo {
861
- /**
862
- * The nesting level of the test.
863
- */
864
- nesting: number;
865
- /**
866
- * The number of subtests that have ran.
867
- */
868
- count: number;
869
- }
870
- interface TestStart extends LocationInfo {
871
- /**
872
- * The test name.
873
- */
874
- name: string;
875
- /**
876
- * The nesting level of the test.
877
- */
878
- nesting: number;
879
- }
880
- interface TestStderr {
881
- /**
882
- * The path of the test file.
883
- */
884
- file: string;
885
- /**
886
- * The message written to `stderr`.
887
- */
888
- message: string;
889
- }
890
- interface TestStdout {
891
- /**
892
- * The path of the test file.
893
- */
894
- file: string;
895
- /**
896
- * The message written to `stdout`.
897
- */
898
- message: string;
899
- }
900
- interface TestSummary {
901
- /**
902
- * An object containing the counts of various test results.
903
- */
904
- counts: {
905
- /**
906
- * The total number of cancelled tests.
907
- */
908
- cancelled: number;
909
- /**
910
- * The total number of passed tests.
911
- */
912
- passed: number;
913
- /**
914
- * The total number of skipped tests.
915
- */
916
- skipped: number;
917
- /**
918
- * The total number of suites run.
919
- */
920
- suites: number;
921
- /**
922
- * The total number of tests run, excluding suites.
923
- */
924
- tests: number;
925
- /**
926
- * The total number of TODO tests.
927
- */
928
- todo: number;
929
- /**
930
- * The total number of top level tests and suites.
931
- */
932
- topLevel: number;
933
- };
934
- /**
935
- * The duration of the test run in milliseconds.
936
- */
937
- duration_ms: number;
938
- /**
939
- * The path of the test file that generated the
940
- * summary. If the summary corresponds to multiple files, this value is
941
- * `undefined`.
942
- */
943
- file: string | undefined;
944
- /**
945
- * Indicates whether or not the test run is considered
946
- * successful or not. If any error condition occurs, such as a failing test or
947
- * unmet coverage threshold, this value will be set to `false`.
948
- */
949
- success: boolean;
950
- }
951
- }
952
- /**
953
- * An instance of `TestContext` is passed to each test function in order to
954
- * interact with the test runner. However, the `TestContext` constructor is not
955
- * exposed as part of the API.
956
- * @since v18.0.0, v16.17.0
957
- */
958
- interface TestContext {
959
- /**
960
- * An object containing assertion methods bound to the test context.
961
- * The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
962
- *
963
- * **Note:** Some of the functions from `node:assert` contain type assertions. If these are called via the
964
- * TestContext `assert` object, then the context parameter in the test's function signature **must be explicitly typed**
965
- * (ie. the parameter must have a type annotation), otherwise an error will be raised by the TypeScript compiler:
966
- * ```ts
967
- * import { test, type TestContext } from 'node:test';
968
- *
969
- * // The test function's context parameter must have a type annotation.
970
- * test('example', (t: TestContext) => {
971
- * t.assert.deepStrictEqual(actual, expected);
972
- * });
973
- *
974
- * // Omitting the type annotation will result in a compilation error.
975
- * test('example', t => {
976
- * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
977
- * });
978
- * ```
979
- * @since v22.2.0, v20.15.0
980
- */
981
- readonly assert: TestContextAssert;
982
- /**
983
- * This function is used to create a hook running before subtest of the current test.
984
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
985
- * If the hook uses callbacks, the callback function is passed as the second argument.
986
- * @param options Configuration options for the hook.
987
- * @since v20.1.0, v18.17.0
988
- */
989
- before(fn?: TestContextHookFn, options?: HookOptions): void;
990
- /**
991
- * This function is used to create a hook running before each subtest of the current test.
992
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
993
- * If the hook uses callbacks, the callback function is passed as the second argument.
994
- * @param options Configuration options for the hook.
995
- * @since v18.8.0
996
- */
997
- beforeEach(fn?: TestContextHookFn, options?: HookOptions): void;
998
- /**
999
- * This function is used to create a hook that runs after the current test finishes.
1000
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
1001
- * If the hook uses callbacks, the callback function is passed as the second argument.
1002
- * @param options Configuration options for the hook.
1003
- * @since v18.13.0
1004
- */
1005
- after(fn?: TestContextHookFn, options?: HookOptions): void;
1006
- /**
1007
- * This function is used to create a hook running after each subtest of the current test.
1008
- * @param fn The hook function. The first argument to this function is a `TestContext` object.
1009
- * If the hook uses callbacks, the callback function is passed as the second argument.
1010
- * @param options Configuration options for the hook.
1011
- * @since v18.8.0
1012
- */
1013
- afterEach(fn?: TestContextHookFn, options?: HookOptions): void;
1014
- /**
1015
- * This function is used to write diagnostics to the output. Any diagnostic
1016
- * information is included at the end of the test's results. This function does
1017
- * not return a value.
1018
- *
1019
- * ```js
1020
- * test('top level test', (t) => {
1021
- * t.diagnostic('A diagnostic message');
1022
- * });
1023
- * ```
1024
- * @since v18.0.0, v16.17.0
1025
- * @param message Message to be reported.
1026
- */
1027
- diagnostic(message: string): void;
1028
- /**
1029
- * The absolute path of the test file that created the current test. If a test file imports
1030
- * additional modules that generate tests, the imported tests will return the path of the root test file.
1031
- * @since v22.6.0
1032
- */
1033
- readonly filePath: string | undefined;
1034
- /**
1035
- * The name of the test and each of its ancestors, separated by `>`.
1036
- * @since v22.3.0
1037
- */
1038
- readonly fullName: string;
1039
- /**
1040
- * The name of the test.
1041
- * @since v18.8.0, v16.18.0
1042
- */
1043
- readonly name: string;
1044
- /**
1045
- * Indicated whether the test succeeded.
1046
- * @since v21.7.0, v20.12.0
1047
- */
1048
- readonly passed: boolean;
1049
- /**
1050
- * The failure reason for the test/case; wrapped and available via `context.error.cause`.
1051
- * @since v21.7.0, v20.12.0
1052
- */
1053
- readonly error: EventData.Error | null;
1054
- /**
1055
- * Number of times the test has been attempted.
1056
- * @since v21.7.0, v20.12.0
1057
- */
1058
- readonly attempt: number;
1059
- /**
1060
- * This function is used to set the number of assertions and subtests that are expected to run
1061
- * within the test. If the number of assertions and subtests that run does not match the
1062
- * expected count, the test will fail.
1063
- *
1064
- * > Note: To make sure assertions are tracked, `t.assert` must be used instead of `assert` directly.
1065
- *
1066
- * ```js
1067
- * test('top level test', (t) => {
1068
- * t.plan(2);
1069
- * t.assert.ok('some relevant assertion here');
1070
- * t.test('subtest', () => {});
1071
- * });
1072
- * ```
1073
- *
1074
- * When working with asynchronous code, the `plan` function can be used to ensure that the
1075
- * correct number of assertions are run:
1076
- *
1077
- * ```js
1078
- * test('planning with streams', (t, done) => {
1079
- * function* generate() {
1080
- * yield 'a';
1081
- * yield 'b';
1082
- * yield 'c';
1083
- * }
1084
- * const expected = ['a', 'b', 'c'];
1085
- * t.plan(expected.length);
1086
- * const stream = Readable.from(generate());
1087
- * stream.on('data', (chunk) => {
1088
- * t.assert.strictEqual(chunk, expected.shift());
1089
- * });
1090
- *
1091
- * stream.on('end', () => {
1092
- * done();
1093
- * });
1094
- * });
1095
- * ```
1096
- *
1097
- * When using the `wait` option, you can control how long the test will wait for the expected assertions.
1098
- * For example, setting a maximum wait time ensures that the test will wait for asynchronous assertions
1099
- * to complete within the specified timeframe:
1100
- *
1101
- * ```js
1102
- * test('plan with wait: 2000 waits for async assertions', (t) => {
1103
- * t.plan(1, { wait: 2000 }); // Waits for up to 2 seconds for the assertion to complete.
1104
- *
1105
- * const asyncActivity = () => {
1106
- * setTimeout(() => {
1107
- * * t.assert.ok(true, 'Async assertion completed within the wait time');
1108
- * }, 1000); // Completes after 1 second, within the 2-second wait time.
1109
- * };
1110
- *
1111
- * asyncActivity(); // The test will pass because the assertion is completed in time.
1112
- * });
1113
- * ```
1114
- *
1115
- * Note: If a `wait` timeout is specified, it begins counting down only after the test function finishes executing.
1116
- * @since v22.2.0
1117
- */
1118
- plan(count: number, options?: TestContextPlanOptions): void;
1119
- /**
1120
- * If `shouldRunOnlyTests` is truthy, the test context will only run tests that
1121
- * have the `only` option set. Otherwise, all tests are run. If Node.js was not
1122
- * started with the `--test-only` command-line option, this function is a
1123
- * no-op.
1124
- *
1125
- * ```js
1126
- * test('top level test', (t) => {
1127
- * // The test context can be set to run subtests with the 'only' option.
1128
- * t.runOnly(true);
1129
- * return Promise.all([
1130
- * t.test('this subtest is now skipped'),
1131
- * t.test('this subtest is run', { only: true }),
1132
- * ]);
1133
- * });
1134
- * ```
1135
- * @since v18.0.0, v16.17.0
1136
- * @param shouldRunOnlyTests Whether or not to run `only` tests.
1137
- */
1138
- runOnly(shouldRunOnlyTests: boolean): void;
1139
- /**
1140
- * ```js
1141
- * test('top level test', async (t) => {
1142
- * await fetch('some/uri', { signal: t.signal });
1143
- * });
1144
- * ```
1145
- * @since v18.7.0, v16.17.0
1146
- */
1147
- readonly signal: AbortSignal;
1148
- /**
1149
- * This function causes the test's output to indicate the test as skipped. If `message` is provided, it is included in the output. Calling `skip()` does
1150
- * not terminate execution of the test function. This function does not return a
1151
- * value.
1152
- *
1153
- * ```js
1154
- * test('top level test', (t) => {
1155
- * // Make sure to return here as well if the test contains additional logic.
1156
- * t.skip('this is skipped');
1157
- * });
1158
- * ```
1159
- * @since v18.0.0, v16.17.0
1160
- * @param message Optional skip message.
1161
- */
1162
- skip(message?: string): void;
1163
- /**
1164
- * This function adds a `TODO` directive to the test's output. If `message` is
1165
- * provided, it is included in the output. Calling `todo()` does not terminate
1166
- * execution of the test function. This function does not return a value.
1167
- *
1168
- * ```js
1169
- * test('top level test', (t) => {
1170
- * // This test is marked as `TODO`
1171
- * t.todo('this is a todo');
1172
- * });
1173
- * ```
1174
- * @since v18.0.0, v16.17.0
1175
- * @param message Optional `TODO` message.
1176
- */
1177
- todo(message?: string): void;
1178
- /**
1179
- * This function is used to create subtests under the current test. This function behaves in
1180
- * the same fashion as the top level {@link test} function.
1181
- * @since v18.0.0
1182
- * @param name The name of the test, which is displayed when reporting test results.
1183
- * Defaults to the `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.
1184
- * @param options Configuration options for the test.
1185
- * @param fn The function under test. This first argument to this function is a {@link TestContext} object.
1186
- * If the test uses callbacks, the callback function is passed as the second argument.
1187
- * @returns A {@link Promise} resolved with `undefined` once the test completes.
1188
- */
1189
- test: typeof test;
1190
- /**
1191
- * This method polls a `condition` function until that function either returns
1192
- * successfully or the operation times out.
1193
- * @since v22.14.0
1194
- * @param condition An assertion function that is invoked
1195
- * periodically until it completes successfully or the defined polling timeout
1196
- * elapses. Successful completion is defined as not throwing or rejecting. This
1197
- * function does not accept any arguments, and is allowed to return any value.
1198
- * @param options An optional configuration object for the polling operation.
1199
- * @returns Fulfilled with the value returned by `condition`.
1200
- */
1201
- waitFor<T>(condition: () => T, options?: TestContextWaitForOptions): Promise<Awaited<T>>;
1202
- /**
1203
- * Each test provides its own MockTracker instance.
1204
- */
1205
- readonly mock: MockTracker;
1206
- }
1207
- interface TestContextAssert extends Pick<typeof import("assert"), AssertMethodNames> {
1208
- /**
1209
- * This function serializes `value` and writes it to the file specified by `path`.
1210
- *
1211
- * ```js
1212
- * test('snapshot test with default serialization', (t) => {
1213
- * t.assert.fileSnapshot({ value1: 1, value2: 2 }, './snapshots/snapshot.json');
1214
- * });
1215
- * ```
1216
- *
1217
- * This function differs from `context.assert.snapshot()` in the following ways:
1218
- *
1219
- * * The snapshot file path is explicitly provided by the user.
1220
- * * Each snapshot file is limited to a single snapshot value.
1221
- * * No additional escaping is performed by the test runner.
1222
- *
1223
- * These differences allow snapshot files to better support features such as syntax
1224
- * highlighting.
1225
- * @since v22.14.0
1226
- * @param value A value to serialize to a string. If Node.js was started with
1227
- * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots)
1228
- * flag, the serialized value is written to
1229
- * `path`. Otherwise, the serialized value is compared to the contents of the
1230
- * existing snapshot file.
1231
- * @param path The file where the serialized `value` is written.
1232
- * @param options Optional configuration options.
1233
- */
1234
- fileSnapshot(value: any, path: string, options?: AssertSnapshotOptions): void;
1235
- /**
1236
- * This function implements assertions for snapshot testing.
1237
- * ```js
1238
- * test('snapshot test with default serialization', (t) => {
1239
- * t.assert.snapshot({ value1: 1, value2: 2 });
1240
- * });
1241
- *
1242
- * test('snapshot test with custom serialization', (t) => {
1243
- * t.assert.snapshot({ value3: 3, value4: 4 }, {
1244
- * serializers: [(value) => JSON.stringify(value)]
1245
- * });
1246
- * });
1247
- * ```
1248
- * @since v22.3.0
1249
- * @param value A value to serialize to a string. If Node.js was started with
1250
- * the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots)
1251
- * flag, the serialized value is written to
1252
- * the snapshot file. Otherwise, the serialized value is compared to the
1253
- * corresponding value in the existing snapshot file.
1254
- */
1255
- snapshot(value: any, options?: AssertSnapshotOptions): void;
1256
- /**
1257
- * A custom assertion function registered with `assert.register()`.
1258
- */
1259
- [name: string]: (...args: any[]) => void;
1260
- }
1261
- interface AssertSnapshotOptions {
1262
- /**
1263
- * An array of synchronous functions used to serialize `value` into a string.
1264
- * `value` is passed as the only argument to the first serializer function.
1265
- * The return value of each serializer is passed as input to the next serializer.
1266
- * Once all serializers have run, the resulting value is coerced to a string.
1267
- *
1268
- * If no serializers are provided, the test runner's default serializers are used.
1269
- */
1270
- serializers?: ReadonlyArray<(value: any) => any> | undefined;
1271
- }
1272
- interface TestContextPlanOptions {
1273
- /**
1274
- * The wait time for the plan:
1275
- * * If `true`, the plan waits indefinitely for all assertions and subtests to run.
1276
- * * If `false`, the plan performs an immediate check after the test function completes,
1277
- * without waiting for any pending assertions or subtests.
1278
- * Any assertions or subtests that complete after this check will not be counted towards the plan.
1279
- * * If a number, it specifies the maximum wait time in milliseconds
1280
- * before timing out while waiting for expected assertions and subtests to be matched.
1281
- * If the timeout is reached, the test will fail.
1282
- * @default false
1283
- */
1284
- wait?: boolean | number | undefined;
1285
- }
1286
- interface TestContextWaitForOptions {
1287
- /**
1288
- * The number of milliseconds to wait after an unsuccessful
1289
- * invocation of `condition` before trying again.
1290
- * @default 50
1291
- */
1292
- interval?: number | undefined;
1293
- /**
1294
- * The poll timeout in milliseconds. If `condition` has not
1295
- * succeeded by the time this elapses, an error occurs.
1296
- * @default 1000
1297
- */
1298
- timeout?: number | undefined;
1299
- }
1300
- /**
1301
- * An instance of `SuiteContext` is passed to each suite function in order to
1302
- * interact with the test runner. However, the `SuiteContext` constructor is not
1303
- * exposed as part of the API.
1304
- * @since v18.7.0, v16.17.0
1305
- */
1306
- interface SuiteContext {
1307
- /**
1308
- * The absolute path of the test file that created the current suite. If a test file imports
1309
- * additional modules that generate suites, the imported suites will return the path of the root test file.
1310
- * @since v22.6.0
1311
- */
1312
- readonly filePath: string | undefined;
1313
- /**
1314
- * The name of the suite and each of its ancestors, separated by `>`.
1315
- * @since v22.3.0, v20.16.0
1316
- */
1317
- readonly fullName: string;
1318
- /**
1319
- * The name of the suite.
1320
- * @since v18.8.0, v16.18.0
1321
- */
1322
- readonly name: string;
1323
- /**
1324
- * Can be used to abort test subtasks when the test has been aborted.
1325
- * @since v18.7.0, v16.17.0
1326
- */
1327
- readonly signal: AbortSignal;
1328
- }
1329
- interface TestOptions {
1330
- /**
1331
- * If a number is provided, then that many tests would run in parallel.
1332
- * If truthy, it would run (number of cpu cores - 1) tests in parallel.
1333
- * For subtests, it will be `Infinity` tests in parallel.
1334
- * If falsy, it would only run one test at a time.
1335
- * If unspecified, subtests inherit this value from their parent.
1336
- * @default false
1337
- */
1338
- concurrency?: number | boolean | undefined;
1339
- /**
1340
- * If truthy, and the test context is configured to run `only` tests, then this test will be
1341
- * run. Otherwise, the test is skipped.
1342
- * @default false
1343
- */
1344
- only?: boolean | undefined;
1345
- /**
1346
- * Allows aborting an in-progress test.
1347
- * @since v18.8.0
1348
- */
1349
- signal?: AbortSignal | undefined;
1350
- /**
1351
- * If truthy, the test is skipped. If a string is provided, that string is displayed in the
1352
- * test results as the reason for skipping the test.
1353
- * @default false
1354
- */
1355
- skip?: boolean | string | undefined;
1356
- /**
1357
- * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
1358
- * value from their parent.
1359
- * @default Infinity
1360
- * @since v18.7.0
1361
- */
1362
- timeout?: number | undefined;
1363
- /**
1364
- * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
1365
- * the test results as the reason why the test is `TODO`.
1366
- * @default false
1367
- */
1368
- todo?: boolean | string | undefined;
1369
- /**
1370
- * The number of assertions and subtests expected to be run in the test.
1371
- * If the number of assertions run in the test does not match the number
1372
- * specified in the plan, the test will fail.
1373
- * @default undefined
1374
- * @since v22.2.0
1375
- */
1376
- plan?: number | undefined;
1377
- // added in v25.5.0, undocumented
1378
- expectFailure?: boolean | undefined;
1379
- }
1380
- /**
1381
- * This function creates a hook that runs before executing a suite.
1382
- *
1383
- * ```js
1384
- * describe('tests', async () => {
1385
- * before(() => console.log('about to run some test'));
1386
- * it('is a subtest', () => {
1387
- * // Some relevant assertion here
1388
- * });
1389
- * });
1390
- * ```
1391
- * @since v18.8.0, v16.18.0
1392
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
1393
- * @param options Configuration options for the hook.
1394
- */
1395
- function before(fn?: HookFn, options?: HookOptions): void;
1396
- /**
1397
- * This function creates a hook that runs after executing a suite.
1398
- *
1399
- * ```js
1400
- * describe('tests', async () => {
1401
- * after(() => console.log('finished running tests'));
1402
- * it('is a subtest', () => {
1403
- * // Some relevant assertion here
1404
- * });
1405
- * });
1406
- * ```
1407
- * @since v18.8.0, v16.18.0
1408
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
1409
- * @param options Configuration options for the hook.
1410
- */
1411
- function after(fn?: HookFn, options?: HookOptions): void;
1412
- /**
1413
- * This function creates a hook that runs before each test in the current suite.
1414
- *
1415
- * ```js
1416
- * describe('tests', async () => {
1417
- * beforeEach(() => console.log('about to run a test'));
1418
- * it('is a subtest', () => {
1419
- * // Some relevant assertion here
1420
- * });
1421
- * });
1422
- * ```
1423
- * @since v18.8.0, v16.18.0
1424
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
1425
- * @param options Configuration options for the hook.
1426
- */
1427
- function beforeEach(fn?: HookFn, options?: HookOptions): void;
1428
- /**
1429
- * This function creates a hook that runs after each test in the current suite.
1430
- * The `afterEach()` hook is run even if the test fails.
1431
- *
1432
- * ```js
1433
- * describe('tests', async () => {
1434
- * afterEach(() => console.log('finished running a test'));
1435
- * it('is a subtest', () => {
1436
- * // Some relevant assertion here
1437
- * });
1438
- * });
1439
- * ```
1440
- * @since v18.8.0, v16.18.0
1441
- * @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
1442
- * @param options Configuration options for the hook.
1443
- */
1444
- function afterEach(fn?: HookFn, options?: HookOptions): void;
1445
- /**
1446
- * The hook function. The first argument is the context in which the hook is called.
1447
- * If the hook uses callbacks, the callback function is passed as the second argument.
1448
- */
1449
- type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any;
1450
- /**
1451
- * The hook function. The first argument is a `TestContext` object.
1452
- * If the hook uses callbacks, the callback function is passed as the second argument.
1453
- */
1454
- type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any;
1455
- /**
1456
- * Configuration options for hooks.
1457
- * @since v18.8.0
1458
- */
1459
- interface HookOptions {
1460
- /**
1461
- * Allows aborting an in-progress hook.
1462
- */
1463
- signal?: AbortSignal | undefined;
1464
- /**
1465
- * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
1466
- * value from their parent.
1467
- * @default Infinity
1468
- */
1469
- timeout?: number | undefined;
1470
- }
1471
- interface MockFunctionOptions {
1472
- /**
1473
- * The number of times that the mock will use the behavior of `implementation`.
1474
- * Once the mock function has been called `times` times,
1475
- * it will automatically restore the behavior of `original`.
1476
- * This value must be an integer greater than zero.
1477
- * @default Infinity
1478
- */
1479
- times?: number | undefined;
1480
- }
1481
- interface MockMethodOptions extends MockFunctionOptions {
1482
- /**
1483
- * If `true`, `object[methodName]` is treated as a getter.
1484
- * This option cannot be used with the `setter` option.
1485
- */
1486
- getter?: boolean | undefined;
1487
- /**
1488
- * If `true`, `object[methodName]` is treated as a setter.
1489
- * This option cannot be used with the `getter` option.
1490
- */
1491
- setter?: boolean | undefined;
1492
- }
1493
- type Mock<F extends Function> = F & {
1494
- mock: MockFunctionContext<F>;
1495
- };
1496
- interface MockModuleOptions {
1497
- /**
1498
- * If false, each call to `require()` or `import()` generates a new mock module.
1499
- * If true, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache.
1500
- * @default false
1501
- */
1502
- cache?: boolean | undefined;
1503
- /**
1504
- * The value to use as the mocked module's default export.
1505
- *
1506
- * If this value is not provided, ESM mocks do not include a default export.
1507
- * If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`.
1508
- * If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`.
1509
- */
1510
- defaultExport?: any;
1511
- /**
1512
- * An object whose keys and values are used to create the named exports of the mock module.
1513
- *
1514
- * If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`.
1515
- * Therefore, if a mock is created with both named exports and a non-object default export,
1516
- * the mock will throw an exception when used as a CJS or builtin module.
1517
- */
1518
- namedExports?: object | undefined;
1519
- }
1520
- /**
1521
- * The `MockTracker` class is used to manage mocking functionality. The test runner
1522
- * module provides a top level `mock` export which is a `MockTracker` instance.
1523
- * Each test also provides its own `MockTracker` instance via the test context's `mock` property.
1524
- * @since v19.1.0, v18.13.0
1525
- */
1526
- interface MockTracker {
1527
- /**
1528
- * This function is used to create a mock function.
1529
- *
1530
- * The following example creates a mock function that increments a counter by one
1531
- * on each invocation. The `times` option is used to modify the mock behavior such
1532
- * that the first two invocations add two to the counter instead of one.
1533
- *
1534
- * ```js
1535
- * test('mocks a counting function', (t) => {
1536
- * let cnt = 0;
1537
- *
1538
- * function addOne() {
1539
- * cnt++;
1540
- * return cnt;
1541
- * }
1542
- *
1543
- * function addTwo() {
1544
- * cnt += 2;
1545
- * return cnt;
1546
- * }
1547
- *
1548
- * const fn = t.mock.fn(addOne, addTwo, { times: 2 });
1549
- *
1550
- * assert.strictEqual(fn(), 2);
1551
- * assert.strictEqual(fn(), 4);
1552
- * assert.strictEqual(fn(), 5);
1553
- * assert.strictEqual(fn(), 6);
1554
- * });
1555
- * ```
1556
- * @since v19.1.0, v18.13.0
1557
- * @param original An optional function to create a mock on.
1558
- * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and
1559
- * then restore the behavior of `original`.
1560
- * @param options Optional configuration options for the mock function.
1561
- * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the
1562
- * behavior of the mocked function.
1563
- */
1564
- fn<F extends Function = (...args: any[]) => undefined>(
1565
- original?: F,
1566
- options?: MockFunctionOptions,
1567
- ): Mock<F>;
1568
- fn<F extends Function = (...args: any[]) => undefined, Implementation extends Function = F>(
1569
- original?: F,
1570
- implementation?: Implementation,
1571
- options?: MockFunctionOptions,
1572
- ): Mock<F | Implementation>;
1573
- /**
1574
- * This function is used to create a mock on an existing object method. The
1575
- * following example demonstrates how a mock is created on an existing object
1576
- * method.
1577
- *
1578
- * ```js
1579
- * test('spies on an object method', (t) => {
1580
- * const number = {
1581
- * value: 5,
1582
- * subtract(a) {
1583
- * return this.value - a;
1584
- * },
1585
- * };
1586
- *
1587
- * t.mock.method(number, 'subtract');
1588
- * assert.strictEqual(number.subtract.mock.calls.length, 0);
1589
- * assert.strictEqual(number.subtract(3), 2);
1590
- * assert.strictEqual(number.subtract.mock.calls.length, 1);
1591
- *
1592
- * const call = number.subtract.mock.calls[0];
1593
- *
1594
- * assert.deepStrictEqual(call.arguments, [3]);
1595
- * assert.strictEqual(call.result, 2);
1596
- * assert.strictEqual(call.error, undefined);
1597
- * assert.strictEqual(call.target, undefined);
1598
- * assert.strictEqual(call.this, number);
1599
- * });
1600
- * ```
1601
- * @since v19.1.0, v18.13.0
1602
- * @param object The object whose method is being mocked.
1603
- * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.
1604
- * @param implementation An optional function used as the mock implementation for `object[methodName]`.
1605
- * @param options Optional configuration options for the mock method.
1606
- * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the
1607
- * behavior of the mocked method.
1608
- */
1609
- method<
1610
- MockedObject extends object,
1611
- MethodName extends FunctionPropertyNames<MockedObject>,
1612
- >(
1613
- object: MockedObject,
1614
- methodName: MethodName,
1615
- options?: MockFunctionOptions,
1616
- ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName]>
1617
- : never;
1618
- method<
1619
- MockedObject extends object,
1620
- MethodName extends FunctionPropertyNames<MockedObject>,
1621
- Implementation extends Function,
1622
- >(
1623
- object: MockedObject,
1624
- methodName: MethodName,
1625
- implementation: Implementation,
1626
- options?: MockFunctionOptions,
1627
- ): MockedObject[MethodName] extends Function ? Mock<MockedObject[MethodName] | Implementation>
1628
- : never;
1629
- method<MockedObject extends object>(
1630
- object: MockedObject,
1631
- methodName: keyof MockedObject,
1632
- options: MockMethodOptions,
1633
- ): Mock<Function>;
1634
- method<MockedObject extends object>(
1635
- object: MockedObject,
1636
- methodName: keyof MockedObject,
1637
- implementation: Function,
1638
- options: MockMethodOptions,
1639
- ): Mock<Function>;
1640
- /**
1641
- * This function is syntax sugar for `MockTracker.method` with `options.getter` set to `true`.
1642
- * @since v19.3.0, v18.13.0
1643
- */
1644
- getter<
1645
- MockedObject extends object,
1646
- MethodName extends keyof MockedObject,
1647
- >(
1648
- object: MockedObject,
1649
- methodName: MethodName,
1650
- options?: MockFunctionOptions,
1651
- ): Mock<() => MockedObject[MethodName]>;
1652
- getter<
1653
- MockedObject extends object,
1654
- MethodName extends keyof MockedObject,
1655
- Implementation extends Function,
1656
- >(
1657
- object: MockedObject,
1658
- methodName: MethodName,
1659
- implementation?: Implementation,
1660
- options?: MockFunctionOptions,
1661
- ): Mock<(() => MockedObject[MethodName]) | Implementation>;
1662
- /**
1663
- * This function is syntax sugar for `MockTracker.method` with `options.setter` set to `true`.
1664
- * @since v19.3.0, v18.13.0
1665
- */
1666
- setter<
1667
- MockedObject extends object,
1668
- MethodName extends keyof MockedObject,
1669
- >(
1670
- object: MockedObject,
1671
- methodName: MethodName,
1672
- options?: MockFunctionOptions,
1673
- ): Mock<(value: MockedObject[MethodName]) => void>;
1674
- setter<
1675
- MockedObject extends object,
1676
- MethodName extends keyof MockedObject,
1677
- Implementation extends Function,
1678
- >(
1679
- object: MockedObject,
1680
- methodName: MethodName,
1681
- implementation?: Implementation,
1682
- options?: MockFunctionOptions,
1683
- ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>;
1684
- /**
1685
- * This function is used to mock the exports of ECMAScript modules, CommonJS modules, JSON modules, and
1686
- * Node.js builtin modules. Any references to the original module prior to mocking are not impacted. In
1687
- * order to enable module mocking, Node.js must be started with the
1688
- * [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-module-mocks)
1689
- * command-line flag.
1690
- *
1691
- * The following example demonstrates how a mock is created for a module.
1692
- *
1693
- * ```js
1694
- * test('mocks a builtin module in both module systems', async (t) => {
1695
- * // Create a mock of 'node:readline' with a named export named 'fn', which
1696
- * // does not exist in the original 'node:readline' module.
1697
- * const mock = t.mock.module('node:readline', {
1698
- * namedExports: { fn() { return 42; } },
1699
- * });
1700
- *
1701
- * let esmImpl = await import('node:readline');
1702
- * let cjsImpl = require('node:readline');
1703
- *
1704
- * // cursorTo() is an export of the original 'node:readline' module.
1705
- * assert.strictEqual(esmImpl.cursorTo, undefined);
1706
- * assert.strictEqual(cjsImpl.cursorTo, undefined);
1707
- * assert.strictEqual(esmImpl.fn(), 42);
1708
- * assert.strictEqual(cjsImpl.fn(), 42);
1709
- *
1710
- * mock.restore();
1711
- *
1712
- * // The mock is restored, so the original builtin module is returned.
1713
- * esmImpl = await import('node:readline');
1714
- * cjsImpl = require('node:readline');
1715
- *
1716
- * assert.strictEqual(typeof esmImpl.cursorTo, 'function');
1717
- * assert.strictEqual(typeof cjsImpl.cursorTo, 'function');
1718
- * assert.strictEqual(esmImpl.fn, undefined);
1719
- * assert.strictEqual(cjsImpl.fn, undefined);
1720
- * });
1721
- * ```
1722
- * @since v22.3.0
1723
- * @experimental
1724
- * @param specifier A string identifying the module to mock.
1725
- * @param options Optional configuration options for the mock module.
1726
- */
1727
- module(specifier: string | URL, options?: MockModuleOptions): MockModuleContext;
1728
- /**
1729
- * Creates a mock for a property value on an object. This allows you to track and control access to a specific property,
1730
- * including how many times it is read (getter) or written (setter), and to restore the original value after mocking.
1731
- *
1732
- * ```js
1733
- * test('mocks a property value', (t) => {
1734
- * const obj = { foo: 42 };
1735
- * const prop = t.mock.property(obj, 'foo', 100);
1736
- *
1737
- * assert.strictEqual(obj.foo, 100);
1738
- * assert.strictEqual(prop.mock.accessCount(), 1);
1739
- * assert.strictEqual(prop.mock.accesses[0].type, 'get');
1740
- * assert.strictEqual(prop.mock.accesses[0].value, 100);
1741
- *
1742
- * obj.foo = 200;
1743
- * assert.strictEqual(prop.mock.accessCount(), 2);
1744
- * assert.strictEqual(prop.mock.accesses[1].type, 'set');
1745
- * assert.strictEqual(prop.mock.accesses[1].value, 200);
1746
- *
1747
- * prop.mock.restore();
1748
- * assert.strictEqual(obj.foo, 42);
1749
- * });
1750
- * ```
1751
- * @since v24.3.0
1752
- * @param object The object whose value is being mocked.
1753
- * @param propertyName The identifier of the property on `object` to mock.
1754
- * @param value An optional value used as the mock value
1755
- * for `object[propertyName]`. **Default:** The original property value.
1756
- * @returns A proxy to the mocked object. The mocked object contains a
1757
- * special `mock` property, which is an instance of [`MockPropertyContext`][], and
1758
- * can be used for inspecting and changing the behavior of the mocked property.
1759
- */
1760
- property<
1761
- MockedObject extends object,
1762
- PropertyName extends keyof MockedObject,
1763
- >(
1764
- object: MockedObject,
1765
- property: PropertyName,
1766
- value?: MockedObject[PropertyName],
1767
- ): MockedObject & { mock: MockPropertyContext<MockedObject[PropertyName]> };
1768
- /**
1769
- * This function restores the default behavior of all mocks that were previously
1770
- * created by this `MockTracker` and disassociates the mocks from the `MockTracker` instance. Once disassociated, the mocks can still be used, but the `MockTracker` instance can no longer be
1771
- * used to reset their behavior or
1772
- * otherwise interact with them.
1773
- *
1774
- * After each test completes, this function is called on the test context's `MockTracker`. If the global `MockTracker` is used extensively, calling this
1775
- * function manually is recommended.
1776
- * @since v19.1.0, v18.13.0
1777
- */
1778
- reset(): void;
1779
- /**
1780
- * This function restores the default behavior of all mocks that were previously
1781
- * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does
1782
- * not disassociate the mocks from the `MockTracker` instance.
1783
- * @since v19.1.0, v18.13.0
1784
- */
1785
- restoreAll(): void;
1786
- readonly timers: MockTimers;
1787
- }
1788
- const mock: MockTracker;
1789
- interface MockFunctionCall<
1790
- F extends Function,
1791
- ReturnType = F extends (...args: any) => infer T ? T
1792
- : F extends abstract new(...args: any) => infer T ? T
1793
- : unknown,
1794
- Args = F extends (...args: infer Y) => any ? Y
1795
- : F extends abstract new(...args: infer Y) => any ? Y
1796
- : unknown[],
1797
- > {
1798
- /**
1799
- * An array of the arguments passed to the mock function.
1800
- */
1801
- arguments: Args;
1802
- /**
1803
- * If the mocked function threw then this property contains the thrown value.
1804
- */
1805
- error: unknown | undefined;
1806
- /**
1807
- * The value returned by the mocked function.
1808
- *
1809
- * If the mocked function threw, it will be `undefined`.
1810
- */
1811
- result: ReturnType | undefined;
1812
- /**
1813
- * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation.
1814
- */
1815
- stack: Error;
1816
- /**
1817
- * If the mocked function is a constructor, this field contains the class being constructed.
1818
- * Otherwise this will be `undefined`.
1819
- */
1820
- target: F extends abstract new(...args: any) => any ? F : undefined;
1821
- /**
1822
- * The mocked function's `this` value.
1823
- */
1824
- this: unknown;
1825
- }
1826
- /**
1827
- * The `MockFunctionContext` class is used to inspect or manipulate the behavior of
1828
- * mocks created via the `MockTracker` APIs.
1829
- * @since v19.1.0, v18.13.0
1830
- */
1831
- interface MockFunctionContext<F extends Function> {
1832
- /**
1833
- * A getter that returns a copy of the internal array used to track calls to the
1834
- * mock. Each entry in the array is an object with the following properties.
1835
- * @since v19.1.0, v18.13.0
1836
- */
1837
- readonly calls: MockFunctionCall<F>[];
1838
- /**
1839
- * This function returns the number of times that this mock has been invoked. This
1840
- * function is more efficient than checking `ctx.calls.length` because `ctx.calls` is a getter that creates a copy of the internal call tracking array.
1841
- * @since v19.1.0, v18.13.0
1842
- * @return The number of times that this mock has been invoked.
1843
- */
1844
- callCount(): number;
1845
- /**
1846
- * This function is used to change the behavior of an existing mock.
1847
- *
1848
- * The following example creates a mock function using `t.mock.fn()`, calls the
1849
- * mock function, and then changes the mock implementation to a different function.
1850
- *
1851
- * ```js
1852
- * test('changes a mock behavior', (t) => {
1853
- * let cnt = 0;
1854
- *
1855
- * function addOne() {
1856
- * cnt++;
1857
- * return cnt;
1858
- * }
1859
- *
1860
- * function addTwo() {
1861
- * cnt += 2;
1862
- * return cnt;
1863
- * }
1864
- *
1865
- * const fn = t.mock.fn(addOne);
1866
- *
1867
- * assert.strictEqual(fn(), 1);
1868
- * fn.mock.mockImplementation(addTwo);
1869
- * assert.strictEqual(fn(), 3);
1870
- * assert.strictEqual(fn(), 5);
1871
- * });
1872
- * ```
1873
- * @since v19.1.0, v18.13.0
1874
- * @param implementation The function to be used as the mock's new implementation.
1875
- */
1876
- mockImplementation(implementation: F): void;
1877
- /**
1878
- * This function is used to change the behavior of an existing mock for a single
1879
- * invocation. Once invocation `onCall` has occurred, the mock will revert to
1880
- * whatever behavior it would have used had `mockImplementationOnce()` not been
1881
- * called.
1882
- *
1883
- * The following example creates a mock function using `t.mock.fn()`, calls the
1884
- * mock function, changes the mock implementation to a different function for the
1885
- * next invocation, and then resumes its previous behavior.
1886
- *
1887
- * ```js
1888
- * test('changes a mock behavior once', (t) => {
1889
- * let cnt = 0;
1890
- *
1891
- * function addOne() {
1892
- * cnt++;
1893
- * return cnt;
1894
- * }
1895
- *
1896
- * function addTwo() {
1897
- * cnt += 2;
1898
- * return cnt;
1899
- * }
1900
- *
1901
- * const fn = t.mock.fn(addOne);
1902
- *
1903
- * assert.strictEqual(fn(), 1);
1904
- * fn.mock.mockImplementationOnce(addTwo);
1905
- * assert.strictEqual(fn(), 3);
1906
- * assert.strictEqual(fn(), 4);
1907
- * });
1908
- * ```
1909
- * @since v19.1.0, v18.13.0
1910
- * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`.
1911
- * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown.
1912
- */
1913
- mockImplementationOnce(implementation: F, onCall?: number): void;
1914
- /**
1915
- * Resets the call history of the mock function.
1916
- * @since v19.3.0, v18.13.0
1917
- */
1918
- resetCalls(): void;
1919
- /**
1920
- * Resets the implementation of the mock function to its original behavior. The
1921
- * mock can still be used after calling this function.
1922
- * @since v19.1.0, v18.13.0
1923
- */
1924
- restore(): void;
1925
- }
1926
- /**
1927
- * @since v22.3.0
1928
- * @experimental
1929
- */
1930
- interface MockModuleContext {
1931
- /**
1932
- * Resets the implementation of the mock module.
1933
- * @since v22.3.0
1934
- */
1935
- restore(): void;
1936
- }
1937
- /**
1938
- * @since v24.3.0
1939
- */
1940
- class MockPropertyContext<PropertyType = any> {
1941
- /**
1942
- * A getter that returns a copy of the internal array used to track accesses (get/set) to
1943
- * the mocked property. Each entry in the array is an object with the following properties:
1944
- */
1945
- readonly accesses: Array<{
1946
- type: "get" | "set";
1947
- value: PropertyType;
1948
- stack: Error;
1949
- }>;
1950
- /**
1951
- * This function returns the number of times that the property was accessed.
1952
- * This function is more efficient than checking `ctx.accesses.length` because
1953
- * `ctx.accesses` is a getter that creates a copy of the internal access tracking array.
1954
- * @returns The number of times that the property was accessed (read or written).
1955
- */
1956
- accessCount(): number;
1957
- /**
1958
- * This function is used to change the value returned by the mocked property getter.
1959
- * @param value The new value to be set as the mocked property value.
1960
- */
1961
- mockImplementation(value: PropertyType): void;
1962
- /**
1963
- * This function is used to change the behavior of an existing mock for a single
1964
- * invocation. Once invocation `onAccess` has occurred, the mock will revert to
1965
- * whatever behavior it would have used had `mockImplementationOnce()` not been
1966
- * called.
1967
- *
1968
- * The following example creates a mock function using `t.mock.property()`, calls the
1969
- * mock property, changes the mock implementation to a different value for the
1970
- * next invocation, and then resumes its previous behavior.
1971
- *
1972
- * ```js
1973
- * test('changes a mock behavior once', (t) => {
1974
- * const obj = { foo: 1 };
1975
- *
1976
- * const prop = t.mock.property(obj, 'foo', 5);
1977
- *
1978
- * assert.strictEqual(obj.foo, 5);
1979
- * prop.mock.mockImplementationOnce(25);
1980
- * assert.strictEqual(obj.foo, 25);
1981
- * assert.strictEqual(obj.foo, 5);
1982
- * });
1983
- * ```
1984
- * @param value The value to be used as the mock's
1985
- * implementation for the invocation number specified by `onAccess`.
1986
- * @param onAccess The invocation number that will use `value`. If
1987
- * the specified invocation has already occurred then an exception is thrown.
1988
- * **Default:** The number of the next invocation.
1989
- */
1990
- mockImplementationOnce(value: PropertyType, onAccess?: number): void;
1991
- /**
1992
- * Resets the access history of the mocked property.
1993
- */
1994
- resetAccesses(): void;
1995
- /**
1996
- * Resets the implementation of the mock property to its original behavior. The
1997
- * mock can still be used after calling this function.
1998
- */
1999
- restore(): void;
2000
- }
2001
- interface MockTimersOptions {
2002
- apis: ReadonlyArray<"setInterval" | "setTimeout" | "setImmediate" | "Date">;
2003
- now?: number | Date | undefined;
2004
- }
2005
- /**
2006
- * Mocking timers is a technique commonly used in software testing to simulate and
2007
- * control the behavior of timers, such as `setInterval` and `setTimeout`,
2008
- * without actually waiting for the specified time intervals.
2009
- *
2010
- * The MockTimers API also allows for mocking of the `Date` constructor and
2011
- * `setImmediate`/`clearImmediate` functions.
2012
- *
2013
- * The `MockTracker` provides a top-level `timers` export
2014
- * which is a `MockTimers` instance.
2015
- * @since v20.4.0
2016
- */
2017
- interface MockTimers {
2018
- /**
2019
- * Enables timer mocking for the specified timers.
2020
- *
2021
- * **Note:** When you enable mocking for a specific timer, its associated
2022
- * clear function will also be implicitly mocked.
2023
- *
2024
- * **Note:** Mocking `Date` will affect the behavior of the mocked timers
2025
- * as they use the same internal clock.
2026
- *
2027
- * Example usage without setting initial time:
2028
- *
2029
- * ```js
2030
- * import { mock } from 'node:test';
2031
- * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 });
2032
- * ```
2033
- *
2034
- * The above example enables mocking for the `Date` constructor, `setInterval` timer and
2035
- * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`,
2036
- * `setInterval` and `clearInterval` functions from `node:timers`, `node:timers/promises`, and `globalThis` will be mocked.
2037
- *
2038
- * Example usage with initial time set
2039
- *
2040
- * ```js
2041
- * import { mock } from 'node:test';
2042
- * mock.timers.enable({ apis: ['Date'], now: 1000 });
2043
- * ```
2044
- *
2045
- * Example usage with initial Date object as time set
2046
- *
2047
- * ```js
2048
- * import { mock } from 'node:test';
2049
- * mock.timers.enable({ apis: ['Date'], now: new Date() });
2050
- * ```
2051
- *
2052
- * Alternatively, if you call `mock.timers.enable()` without any parameters:
2053
- *
2054
- * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`)
2055
- * will be mocked.
2056
- *
2057
- * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`,
2058
- * and `globalThis` will be mocked.
2059
- * The `Date` constructor from `globalThis` will be mocked.
2060
- *
2061
- * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can
2062
- * set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date
2063
- * object. It can either be a positive integer, or another Date object.
2064
- * @since v20.4.0
2065
- */
2066
- enable(options?: MockTimersOptions): void;
2067
- /**
2068
- * Sets the current Unix timestamp that will be used as reference for any mocked
2069
- * `Date` objects.
2070
- *
2071
- * ```js
2072
- * import assert from 'node:assert';
2073
- * import { test } from 'node:test';
2074
- *
2075
- * test('runAll functions following the given order', (context) => {
2076
- * const now = Date.now();
2077
- * const setTime = 1000;
2078
- * // Date.now is not mocked
2079
- * assert.deepStrictEqual(Date.now(), now);
2080
- *
2081
- * context.mock.timers.enable({ apis: ['Date'] });
2082
- * context.mock.timers.setTime(setTime);
2083
- * // Date.now is now 1000
2084
- * assert.strictEqual(Date.now(), setTime);
2085
- * });
2086
- * ```
2087
- * @since v21.2.0, v20.11.0
2088
- */
2089
- setTime(milliseconds: number): void;
2090
- /**
2091
- * This function restores the default behavior of all mocks that were previously
2092
- * created by this `MockTimers` instance and disassociates the mocks
2093
- * from the `MockTracker` instance.
2094
- *
2095
- * **Note:** After each test completes, this function is called on
2096
- * the test context's `MockTracker`.
2097
- *
2098
- * ```js
2099
- * import { mock } from 'node:test';
2100
- * mock.timers.reset();
2101
- * ```
2102
- * @since v20.4.0
2103
- */
2104
- reset(): void;
2105
- /**
2106
- * Advances time for all mocked timers.
2107
- *
2108
- * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts
2109
- * only positive numbers. In Node.js, `setTimeout` with negative numbers is
2110
- * only supported for web compatibility reasons.
2111
- *
2112
- * The following example mocks a `setTimeout` function and
2113
- * by using `.tick` advances in
2114
- * time triggering all pending timers.
2115
- *
2116
- * ```js
2117
- * import assert from 'node:assert';
2118
- * import { test } from 'node:test';
2119
- *
2120
- * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
2121
- * const fn = context.mock.fn();
2122
- *
2123
- * context.mock.timers.enable({ apis: ['setTimeout'] });
2124
- *
2125
- * setTimeout(fn, 9999);
2126
- *
2127
- * assert.strictEqual(fn.mock.callCount(), 0);
2128
- *
2129
- * // Advance in time
2130
- * context.mock.timers.tick(9999);
2131
- *
2132
- * assert.strictEqual(fn.mock.callCount(), 1);
2133
- * });
2134
- * ```
2135
- *
2136
- * Alternativelly, the `.tick` function can be called many times
2137
- *
2138
- * ```js
2139
- * import assert from 'node:assert';
2140
- * import { test } from 'node:test';
2141
- *
2142
- * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
2143
- * const fn = context.mock.fn();
2144
- * context.mock.timers.enable({ apis: ['setTimeout'] });
2145
- * const nineSecs = 9000;
2146
- * setTimeout(fn, nineSecs);
2147
- *
2148
- * const twoSeconds = 3000;
2149
- * context.mock.timers.tick(twoSeconds);
2150
- * context.mock.timers.tick(twoSeconds);
2151
- * context.mock.timers.tick(twoSeconds);
2152
- *
2153
- * assert.strictEqual(fn.mock.callCount(), 1);
2154
- * });
2155
- * ```
2156
- *
2157
- * Advancing time using `.tick` will also advance the time for any `Date` object
2158
- * created after the mock was enabled (if `Date` was also set to be mocked).
2159
- *
2160
- * ```js
2161
- * import assert from 'node:assert';
2162
- * import { test } from 'node:test';
2163
- *
2164
- * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {
2165
- * const fn = context.mock.fn();
2166
- *
2167
- * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });
2168
- * setTimeout(fn, 9999);
2169
- *
2170
- * assert.strictEqual(fn.mock.callCount(), 0);
2171
- * assert.strictEqual(Date.now(), 0);
2172
- *
2173
- * // Advance in time
2174
- * context.mock.timers.tick(9999);
2175
- * assert.strictEqual(fn.mock.callCount(), 1);
2176
- * assert.strictEqual(Date.now(), 9999);
2177
- * });
2178
- * ```
2179
- * @since v20.4.0
2180
- */
2181
- tick(milliseconds: number): void;
2182
- /**
2183
- * Triggers all pending mocked timers immediately. If the `Date` object is also
2184
- * mocked, it will also advance the `Date` object to the furthest timer's time.
2185
- *
2186
- * The example below triggers all pending timers immediately,
2187
- * causing them to execute without any delay.
2188
- *
2189
- * ```js
2190
- * import assert from 'node:assert';
2191
- * import { test } from 'node:test';
2192
- *
2193
- * test('runAll functions following the given order', (context) => {
2194
- * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });
2195
- * const results = [];
2196
- * setTimeout(() => results.push(1), 9999);
2197
- *
2198
- * // Notice that if both timers have the same timeout,
2199
- * // the order of execution is guaranteed
2200
- * setTimeout(() => results.push(3), 8888);
2201
- * setTimeout(() => results.push(2), 8888);
2202
- *
2203
- * assert.deepStrictEqual(results, []);
2204
- *
2205
- * context.mock.timers.runAll();
2206
- * assert.deepStrictEqual(results, [3, 2, 1]);
2207
- * // The Date object is also advanced to the furthest timer's time
2208
- * assert.strictEqual(Date.now(), 9999);
2209
- * });
2210
- * ```
2211
- *
2212
- * **Note:** The `runAll()` function is specifically designed for
2213
- * triggering timers in the context of timer mocking.
2214
- * It does not have any effect on real-time system
2215
- * clocks or actual timers outside of the mocking environment.
2216
- * @since v20.4.0
2217
- */
2218
- runAll(): void;
2219
- /**
2220
- * Calls {@link MockTimers.reset()}.
2221
- */
2222
- [Symbol.dispose](): void;
2223
- }
2224
- /**
2225
- * An object whose methods are used to configure available assertions on the
2226
- * `TestContext` objects in the current process. The methods from `node:assert`
2227
- * and snapshot testing functions are available by default.
2228
- *
2229
- * It is possible to apply the same configuration to all files by placing common
2230
- * configuration code in a module
2231
- * preloaded with `--require` or `--import`.
2232
- * @since v22.14.0
2233
- */
2234
- namespace assert {
2235
- /**
2236
- * Defines a new assertion function with the provided name and function. If an
2237
- * assertion already exists with the same name, it is overwritten.
2238
- * @since v22.14.0
2239
- */
2240
- function register(name: string, fn: (this: TestContext, ...args: any[]) => void): void;
2241
- }
2242
- /**
2243
- * @since v22.3.0
2244
- */
2245
- namespace snapshot {
2246
- /**
2247
- * This function is used to customize the default serialization mechanism used by the test runner.
2248
- *
2249
- * By default, the test runner performs serialization by calling `JSON.stringify(value, null, 2)` on the provided value.
2250
- * `JSON.stringify()` does have limitations regarding circular structures and supported data types.
2251
- * If a more robust serialization mechanism is required, this function should be used to specify a list of custom serializers.
2252
- *
2253
- * Serializers are called in order, with the output of the previous serializer passed as input to the next.
2254
- * The final result must be a string value.
2255
- * @since v22.3.0
2256
- * @param serializers An array of synchronous functions used as the default serializers for snapshot tests.
2257
- */
2258
- function setDefaultSnapshotSerializers(serializers: ReadonlyArray<(value: any) => any>): void;
2259
- /**
2260
- * This function is used to set a custom resolver for the location of the snapshot file used for snapshot testing.
2261
- * By default, the snapshot filename is the same as the entry point filename with `.snapshot` appended.
2262
- * @since v22.3.0
2263
- * @param fn A function used to compute the location of the snapshot file.
2264
- * The function receives the path of the test file as its only argument. If the
2265
- * test is not associated with a file (for example in the REPL), the input is
2266
- * undefined. `fn()` must return a string specifying the location of the snapshot file.
2267
- */
2268
- function setResolveSnapshotPath(fn: (path: string | undefined) => string): void;
2269
- }
2270
- }
2271
- type FunctionPropertyNames<T> = {
2272
- [K in keyof T]: T[K] extends Function ? K : never;
2273
- }[keyof T];
2274
- export = test;
2275
- }