@samchon/ts-patch 3.2.2 → 3.4.0

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 (1377) hide show
  1. package/.editorconfig +371 -0
  2. package/.gitattributes +2 -0
  3. package/.github/FUNDING.yml +1 -0
  4. package/.github/workflows/build.yml +49 -0
  5. package/.github/workflows/publish.yml +47 -0
  6. package/.idea/codeStyles/Project.xml +28 -0
  7. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  8. package/.idea/compiler.xml +6 -0
  9. package/.idea/inspectionProfiles/Project_Default.xml +98 -0
  10. package/.idea/jsonSchemas.xml +28 -0
  11. package/.idea/misc.xml +9 -0
  12. package/.idea/modules.xml +8 -0
  13. package/.idea/ts-patch.iml +22 -0
  14. package/.idea/vcs.xml +12 -0
  15. package/.idea/webResources.xml +15 -0
  16. package/CHANGELOG.md +7 -0
  17. package/dist/CHANGELOG.md +275 -0
  18. package/dist/LICENSE.md +13 -0
  19. package/dist/README.md +348 -0
  20. package/dist/actions/check.js +53 -0
  21. package/dist/actions/check.js.map +1 -0
  22. package/dist/actions/patch.js +88 -0
  23. package/dist/actions/patch.js.map +1 -0
  24. package/dist/actions/unpatch.js +87 -0
  25. package/dist/actions/unpatch.js.map +1 -0
  26. package/dist/bin/ts-patch.js +43 -0
  27. package/dist/bin/ts-patch.js.map +1 -0
  28. package/dist/cli/cli.js +106 -0
  29. package/dist/cli/cli.js.map +1 -0
  30. package/dist/cli/commands.js +49 -0
  31. package/dist/cli/commands.js.map +1 -0
  32. package/dist/config.js +50 -0
  33. package/dist/config.js.map +1 -0
  34. package/dist/module/module-file.d.ts +10 -0
  35. package/dist/module/module-file.js +102 -0
  36. package/dist/module/module-file.js.map +1 -0
  37. package/dist/module/ts-module.d.ts +40 -0
  38. package/dist/module/ts-module.js +131 -0
  39. package/dist/module/ts-module.js.map +1 -0
  40. package/dist/node_modules/.bin/resolve +15 -0
  41. package/dist/node_modules/.bin/resolve.cmd +7 -0
  42. package/dist/node_modules/.bin/semver +15 -0
  43. package/dist/node_modules/.bin/semver.cmd +7 -0
  44. package/dist/package.json +106 -0
  45. package/dist/patch/get-patched-source.js +69 -0
  46. package/dist/patch/get-patched-source.js.map +1 -0
  47. package/dist/patch/transformers/fix-ts-early-return.js +61 -0
  48. package/dist/patch/transformers/fix-ts-early-return.js.map +1 -0
  49. package/dist/resources/module-patch.js +623 -0
  50. package/dist/system/cache.js +79 -0
  51. package/dist/system/cache.js.map +1 -0
  52. package/dist/utils/file-utils.js +98 -0
  53. package/dist/utils/file-utils.js.map +1 -0
  54. package/jest.config.ts +26 -0
  55. package/package.json +60 -11
  56. package/projects/core/plugin.ts +42 -0
  57. package/projects/core/resolver-hook.js +55 -0
  58. package/projects/core/shared/plugin-types.ts +159 -0
  59. package/projects/core/src/actions/check.ts +79 -0
  60. package/projects/core/src/actions/index.ts +5 -0
  61. package/projects/core/src/actions/install.ts +23 -0
  62. package/projects/core/src/actions/patch.ts +110 -0
  63. package/projects/core/src/actions/uninstall.ts +24 -0
  64. package/projects/core/src/actions/unpatch.ts +109 -0
  65. package/projects/core/src/bin/ts-patch.ts +7 -0
  66. package/projects/core/src/bin/tspc.ts +12 -0
  67. package/projects/core/src/cli/cli.ts +94 -0
  68. package/projects/core/src/cli/commands.ts +55 -0
  69. package/projects/core/src/cli/help-menu.ts +48 -0
  70. package/projects/core/src/cli/options.ts +83 -0
  71. package/projects/core/src/compiler/package.json +4 -0
  72. package/projects/core/src/compiler/tsc.js +19 -0
  73. package/projects/core/src/compiler/tsserver.js +19 -0
  74. package/projects/core/src/compiler/tsserverlibrary.js +19 -0
  75. package/projects/core/src/compiler/typescript.js +19 -0
  76. package/projects/core/src/config.ts +65 -0
  77. package/projects/core/src/index.ts +4 -0
  78. package/projects/core/src/module/get-live-module.ts +25 -0
  79. package/projects/core/src/module/index.ts +4 -0
  80. package/projects/core/src/module/module-file.ts +127 -0
  81. package/projects/core/src/module/module-source.ts +59 -0
  82. package/projects/core/src/module/source-section.ts +110 -0
  83. package/projects/core/src/module/ts-module.ts +187 -0
  84. package/projects/core/src/options.ts +55 -0
  85. package/projects/core/src/patch/get-patched-source.ts +85 -0
  86. package/projects/core/src/patch/patch-detail.ts +106 -0
  87. package/projects/core/src/patch/patch-module.ts +213 -0
  88. package/projects/core/src/patch/transformers/add-original-create-program.ts +129 -0
  89. package/projects/core/src/patch/transformers/fix-ts-early-return.ts +46 -0
  90. package/projects/core/src/patch/transformers/hook-tsc-exec.ts +52 -0
  91. package/projects/core/src/patch/transformers/index.ts +6 -0
  92. package/projects/core/src/patch/transformers/merge-statements.ts +61 -0
  93. package/projects/core/src/patch/transformers/patch-create-program.ts +68 -0
  94. package/projects/core/src/patch/transformers/patch-emitter.ts +75 -0
  95. package/projects/core/src/slice/module-slice.ts +59 -0
  96. package/projects/core/src/slice/ts54.ts +79 -0
  97. package/projects/core/src/slice/ts55.ts +80 -0
  98. package/projects/core/src/slice/ts552.ts +80 -0
  99. package/projects/core/src/system/cache.ts +48 -0
  100. package/projects/core/src/system/errors.ts +39 -0
  101. package/projects/core/src/system/index.ts +4 -0
  102. package/projects/core/src/system/logger.ts +53 -0
  103. package/projects/core/src/system/types.ts +11 -0
  104. package/projects/core/src/ts-package.ts +99 -0
  105. package/projects/core/src/utils/file-utils.ts +104 -0
  106. package/projects/core/src/utils/find-cache-dir.ts +122 -0
  107. package/projects/core/src/utils/general.ts +24 -0
  108. package/projects/core/src/utils/index.ts +3 -0
  109. package/projects/core/tsconfig.json +20 -0
  110. package/projects/patch/package.json +8 -0
  111. package/projects/patch/plugin.ts +128 -0
  112. package/projects/patch/src/plugin/esm-intercept.ts +141 -0
  113. package/projects/patch/src/plugin/plugin-creator.ts +254 -0
  114. package/projects/patch/src/plugin/plugin.ts +193 -0
  115. package/projects/patch/src/plugin/register-plugin.ts +141 -0
  116. package/projects/patch/src/shared.ts +59 -0
  117. package/projects/patch/src/ts/create-program.ts +156 -0
  118. package/projects/patch/src/ts/shim.ts +43 -0
  119. package/projects/patch/src/types/plugin-types.ts +51 -0
  120. package/projects/patch/src/types/typescript.ts +11 -0
  121. package/projects/patch/tsconfig.json +34 -0
  122. package/scripts/postbuild.js +66 -0
  123. package/test/.yarnrc +1 -0
  124. package/test/assets/projects/main/package.json +5 -0
  125. package/test/assets/projects/main/src/index.ts +0 -0
  126. package/test/assets/projects/main/tsconfig.json +16 -0
  127. package/test/assets/projects/package-config/plugin/package.json +8 -0
  128. package/test/assets/projects/package-config/plugin/plugin.js +9 -0
  129. package/test/assets/projects/package-config/plugin/transformers/transformer1.js +28 -0
  130. package/test/assets/projects/package-config/plugin/transformers/transformer2.js +22 -0
  131. package/test/assets/projects/package-config/run-transform.js +72 -0
  132. package/test/assets/projects/package-config/src/index.ts +6 -0
  133. package/test/assets/projects/package-config/tsconfig.json +13 -0
  134. package/test/assets/projects/path-mapping/base.ts +1 -0
  135. package/test/assets/projects/path-mapping/package.json +8 -0
  136. package/test/assets/projects/path-mapping/src/a/a.ts +1 -0
  137. package/test/assets/projects/path-mapping/src/b.ts +1 -0
  138. package/test/assets/projects/path-mapping/src/index.ts +29 -0
  139. package/test/assets/projects/path-mapping/tsconfig.json +18 -0
  140. package/test/assets/projects/path-mapping/tsconfig.plugin.json +15 -0
  141. package/test/assets/projects/transform/package.json +9 -0
  142. package/test/assets/projects/transform/run-transform.js +56 -0
  143. package/test/assets/projects/transform/src/index.ts +4 -0
  144. package/test/assets/projects/transform/transformers/cjs/js-plugin.cjs +19 -0
  145. package/test/assets/projects/transform/transformers/cjs/package.json +3 -0
  146. package/test/assets/projects/transform/transformers/cjs/plugin.cts +17 -0
  147. package/test/assets/projects/transform/transformers/cjs/tsconfig.json +7 -0
  148. package/test/assets/projects/transform/transformers/esm/js-plugin.mjs +17 -0
  149. package/test/assets/projects/transform/transformers/esm/package.json +3 -0
  150. package/test/assets/projects/transform/transformers/esm/plugin.mts +19 -0
  151. package/test/assets/projects/transform/transformers/esm/plugin.ts +19 -0
  152. package/test/assets/projects/transform/transformers/esm/tsconfig.json +7 -0
  153. package/test/assets/projects/transform/tsconfig.cjs.json +12 -0
  154. package/test/assets/projects/transform/tsconfig.cts.json +12 -0
  155. package/test/assets/projects/transform/tsconfig.json +9 -0
  156. package/test/assets/projects/transform/tsconfig.mjs.json +12 -0
  157. package/test/assets/projects/transform/tsconfig.mts.json +11 -0
  158. package/test/assets/projects/transform/tsconfig.ts.json +11 -0
  159. package/test/assets/projects/webpack/esm-plugin.mjs +5 -0
  160. package/test/assets/projects/webpack/esm-plugin.mts +5 -0
  161. package/test/assets/projects/webpack/hide-module.js +24 -0
  162. package/test/assets/projects/webpack/package.json +14 -0
  163. package/test/assets/projects/webpack/plugin.ts +7 -0
  164. package/test/assets/projects/webpack/src/index.ts +0 -0
  165. package/test/assets/projects/webpack/tsconfig.esm.json +8 -0
  166. package/test/assets/projects/webpack/tsconfig.esmts.json +8 -0
  167. package/test/assets/projects/webpack/tsconfig.json +14 -0
  168. package/test/assets/projects/webpack/webpack.config.js +24 -0
  169. package/test/node_modules/.bin/acorn +15 -0
  170. package/test/node_modules/.bin/acorn.cmd +7 -0
  171. package/test/node_modules/.bin/json5 +15 -0
  172. package/test/node_modules/.bin/json5.cmd +7 -0
  173. package/test/node_modules/.bin/node-which +15 -0
  174. package/test/node_modules/.bin/node-which.cmd +7 -0
  175. package/test/node_modules/.bin/resolve +15 -0
  176. package/test/node_modules/.bin/resolve.cmd +7 -0
  177. package/test/node_modules/.bin/semver +15 -0
  178. package/test/node_modules/.bin/semver.cmd +7 -0
  179. package/test/node_modules/.bin/ts-node +15 -0
  180. package/test/node_modules/.bin/ts-node-cwd +15 -0
  181. package/test/node_modules/.bin/ts-node-cwd.cmd +7 -0
  182. package/test/node_modules/.bin/ts-node-esm +15 -0
  183. package/test/node_modules/.bin/ts-node-esm.cmd +7 -0
  184. package/test/node_modules/.bin/ts-node-script +15 -0
  185. package/test/node_modules/.bin/ts-node-script.cmd +7 -0
  186. package/test/node_modules/.bin/ts-node-transpile-only +15 -0
  187. package/test/node_modules/.bin/ts-node-transpile-only.cmd +7 -0
  188. package/test/node_modules/.bin/ts-node.cmd +7 -0
  189. package/test/node_modules/.bin/ts-script +15 -0
  190. package/test/node_modules/.bin/ts-script.cmd +7 -0
  191. package/test/node_modules/.bin/tsc +15 -0
  192. package/test/node_modules/.bin/tsc.cmd +7 -0
  193. package/test/node_modules/.bin/tsserver +15 -0
  194. package/test/node_modules/.bin/tsserver.cmd +7 -0
  195. package/test/node_modules/.yarn-integrity +73 -0
  196. package/test/node_modules/@cspotcode/source-map-support/LICENSE.md +21 -0
  197. package/test/node_modules/@cspotcode/source-map-support/README.md +289 -0
  198. package/test/node_modules/@cspotcode/source-map-support/browser-source-map-support.js +114 -0
  199. package/test/node_modules/@cspotcode/source-map-support/package.json +50 -0
  200. package/test/node_modules/@cspotcode/source-map-support/register-hook-require.d.ts +7 -0
  201. package/test/node_modules/@cspotcode/source-map-support/register-hook-require.js +3 -0
  202. package/test/node_modules/@cspotcode/source-map-support/register.d.ts +7 -0
  203. package/test/node_modules/@cspotcode/source-map-support/register.js +1 -0
  204. package/test/node_modules/@cspotcode/source-map-support/source-map-support.d.ts +76 -0
  205. package/test/node_modules/@cspotcode/source-map-support/source-map-support.js +938 -0
  206. package/test/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
  207. package/test/node_modules/@jridgewell/resolve-uri/README.md +40 -0
  208. package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +232 -0
  209. package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -0
  210. package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +240 -0
  211. package/test/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -0
  212. package/test/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +4 -0
  213. package/test/node_modules/@jridgewell/resolve-uri/package.json +69 -0
  214. package/test/node_modules/@jridgewell/sourcemap-codec/LICENSE +19 -0
  215. package/test/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
  216. package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +423 -0
  217. package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +6 -0
  218. package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +464 -0
  219. package/test/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +6 -0
  220. package/test/node_modules/@jridgewell/sourcemap-codec/package.json +63 -0
  221. package/test/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +345 -0
  222. package/test/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +111 -0
  223. package/test/node_modules/@jridgewell/sourcemap-codec/src/strings.ts +65 -0
  224. package/test/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +55 -0
  225. package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts +50 -0
  226. package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +1 -0
  227. package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +50 -0
  228. package/test/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +1 -0
  229. package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +9 -0
  230. package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +1 -0
  231. package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +9 -0
  232. package/test/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +1 -0
  233. package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts +16 -0
  234. package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map +1 -0
  235. package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +16 -0
  236. package/test/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map +1 -0
  237. package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +7 -0
  238. package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +1 -0
  239. package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +7 -0
  240. package/test/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +1 -0
  241. package/test/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
  242. package/test/node_modules/@jridgewell/trace-mapping/README.md +193 -0
  243. package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +514 -0
  244. package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -0
  245. package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +528 -0
  246. package/test/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -0
  247. package/test/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +8 -0
  248. package/test/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +32 -0
  249. package/test/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +7 -0
  250. package/test/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts +1 -0
  251. package/test/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts +2 -0
  252. package/test/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  253. package/test/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts +4 -0
  254. package/test/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +70 -0
  255. package/test/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +85 -0
  256. package/test/node_modules/@jridgewell/trace-mapping/package.json +70 -0
  257. package/test/node_modules/@tsconfig/node10/LICENSE +21 -0
  258. package/test/node_modules/@tsconfig/node10/README.md +38 -0
  259. package/test/node_modules/@tsconfig/node10/package.json +15 -0
  260. package/test/node_modules/@tsconfig/node10/tsconfig.json +14 -0
  261. package/test/node_modules/@tsconfig/node12/LICENSE +21 -0
  262. package/test/node_modules/@tsconfig/node12/README.md +40 -0
  263. package/test/node_modules/@tsconfig/node12/package.json +1 -0
  264. package/test/node_modules/@tsconfig/node12/tsconfig.json +16 -0
  265. package/test/node_modules/@tsconfig/node14/LICENSE +21 -0
  266. package/test/node_modules/@tsconfig/node14/README.md +40 -0
  267. package/test/node_modules/@tsconfig/node14/package.json +1 -0
  268. package/test/node_modules/@tsconfig/node14/tsconfig.json +16 -0
  269. package/test/node_modules/@tsconfig/node16/LICENSE +21 -0
  270. package/test/node_modules/@tsconfig/node16/README.md +40 -0
  271. package/test/node_modules/@tsconfig/node16/package.json +15 -0
  272. package/test/node_modules/@tsconfig/node16/tsconfig.json +16 -0
  273. package/test/node_modules/@types/fs-extra/LICENSE +21 -0
  274. package/test/node_modules/@types/fs-extra/README.md +16 -0
  275. package/test/node_modules/@types/fs-extra/index.d.ts +563 -0
  276. package/test/node_modules/@types/fs-extra/package.json +67 -0
  277. package/test/node_modules/@types/node/LICENSE +21 -0
  278. package/test/node_modules/@types/node/README.md +15 -0
  279. package/test/node_modules/@types/node/assert/strict.d.ts +105 -0
  280. package/test/node_modules/@types/node/assert.d.ts +955 -0
  281. package/test/node_modules/@types/node/async_hooks.d.ts +623 -0
  282. package/test/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  283. package/test/node_modules/@types/node/buffer.d.ts +1810 -0
  284. package/test/node_modules/@types/node/child_process.d.ts +1433 -0
  285. package/test/node_modules/@types/node/cluster.d.ts +486 -0
  286. package/test/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  287. package/test/node_modules/@types/node/console.d.ts +151 -0
  288. package/test/node_modules/@types/node/constants.d.ts +20 -0
  289. package/test/node_modules/@types/node/crypto.d.ts +4065 -0
  290. package/test/node_modules/@types/node/dgram.d.ts +564 -0
  291. package/test/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
  292. package/test/node_modules/@types/node/dns/promises.d.ts +503 -0
  293. package/test/node_modules/@types/node/dns.d.ts +922 -0
  294. package/test/node_modules/@types/node/domain.d.ts +166 -0
  295. package/test/node_modules/@types/node/events.d.ts +1047 -0
  296. package/test/node_modules/@types/node/fs/promises.d.ts +1329 -0
  297. package/test/node_modules/@types/node/fs.d.ts +4678 -0
  298. package/test/node_modules/@types/node/globals.d.ts +150 -0
  299. package/test/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  300. package/test/node_modules/@types/node/http.d.ts +2188 -0
  301. package/test/node_modules/@types/node/http2.d.ts +2480 -0
  302. package/test/node_modules/@types/node/https.d.ts +405 -0
  303. package/test/node_modules/@types/node/index.d.ts +115 -0
  304. package/test/node_modules/@types/node/inspector/promises.d.ts +41 -0
  305. package/test/node_modules/@types/node/inspector.d.ts +269 -0
  306. package/test/node_modules/@types/node/inspector.generated.d.ts +4401 -0
  307. package/test/node_modules/@types/node/module.d.ts +757 -0
  308. package/test/node_modules/@types/node/net.d.ts +933 -0
  309. package/test/node_modules/@types/node/os.d.ts +507 -0
  310. package/test/node_modules/@types/node/package.json +155 -0
  311. package/test/node_modules/@types/node/path/posix.d.ts +8 -0
  312. package/test/node_modules/@types/node/path/win32.d.ts +8 -0
  313. package/test/node_modules/@types/node/path.d.ts +187 -0
  314. package/test/node_modules/@types/node/perf_hooks.d.ts +643 -0
  315. package/test/node_modules/@types/node/process.d.ts +2175 -0
  316. package/test/node_modules/@types/node/punycode.d.ts +117 -0
  317. package/test/node_modules/@types/node/querystring.d.ts +152 -0
  318. package/test/node_modules/@types/node/quic.d.ts +910 -0
  319. package/test/node_modules/@types/node/readline/promises.d.ts +161 -0
  320. package/test/node_modules/@types/node/readline.d.ts +542 -0
  321. package/test/node_modules/@types/node/repl.d.ts +415 -0
  322. package/test/node_modules/@types/node/sea.d.ts +162 -0
  323. package/test/node_modules/@types/node/sqlite.d.ts +1065 -0
  324. package/test/node_modules/@types/node/stream/consumers.d.ts +38 -0
  325. package/test/node_modules/@types/node/stream/promises.d.ts +211 -0
  326. package/test/node_modules/@types/node/stream/web.d.ts +296 -0
  327. package/test/node_modules/@types/node/stream.d.ts +1770 -0
  328. package/test/node_modules/@types/node/string_decoder.d.ts +67 -0
  329. package/test/node_modules/@types/node/test/reporters.d.ts +96 -0
  330. package/test/node_modules/@types/node/test.d.ts +2275 -0
  331. package/test/node_modules/@types/node/timers/promises.d.ts +108 -0
  332. package/test/node_modules/@types/node/timers.d.ts +159 -0
  333. package/test/node_modules/@types/node/tls.d.ts +1203 -0
  334. package/test/node_modules/@types/node/trace_events.d.ts +197 -0
  335. package/test/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  336. package/test/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  337. package/test/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  338. package/test/node_modules/@types/node/ts5.6/index.d.ts +117 -0
  339. package/test/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  340. package/test/node_modules/@types/node/ts5.7/index.d.ts +117 -0
  341. package/test/node_modules/@types/node/tty.d.ts +250 -0
  342. package/test/node_modules/@types/node/url.d.ts +541 -0
  343. package/test/node_modules/@types/node/util/types.d.ts +558 -0
  344. package/test/node_modules/@types/node/util.d.ts +1687 -0
  345. package/test/node_modules/@types/node/v8.d.ts +988 -0
  346. package/test/node_modules/@types/node/vm.d.ts +1208 -0
  347. package/test/node_modules/@types/node/wasi.d.ts +202 -0
  348. package/test/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  349. package/test/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  350. package/test/node_modules/@types/node/web-globals/console.d.ts +9 -0
  351. package/test/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  352. package/test/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  353. package/test/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  354. package/test/node_modules/@types/node/web-globals/events.d.ts +106 -0
  355. package/test/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  356. package/test/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  357. package/test/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  358. package/test/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  359. package/test/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  360. package/test/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  361. package/test/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  362. package/test/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  363. package/test/node_modules/@types/node/web-globals/url.d.ts +24 -0
  364. package/test/node_modules/@types/node/worker_threads.d.ts +717 -0
  365. package/test/node_modules/@types/node/zlib.d.ts +682 -0
  366. package/test/node_modules/acorn/CHANGELOG.md +972 -0
  367. package/test/node_modules/acorn/LICENSE +21 -0
  368. package/test/node_modules/acorn/README.md +301 -0
  369. package/test/node_modules/acorn/bin/acorn +4 -0
  370. package/test/node_modules/acorn/dist/acorn.d.mts +883 -0
  371. package/test/node_modules/acorn/dist/acorn.d.ts +883 -0
  372. package/test/node_modules/acorn/dist/acorn.js +6295 -0
  373. package/test/node_modules/acorn/dist/acorn.mjs +6266 -0
  374. package/test/node_modules/acorn/dist/bin.js +90 -0
  375. package/test/node_modules/acorn/package.json +50 -0
  376. package/test/node_modules/acorn-walk/CHANGELOG.md +209 -0
  377. package/test/node_modules/acorn-walk/LICENSE +21 -0
  378. package/test/node_modules/acorn-walk/README.md +124 -0
  379. package/test/node_modules/acorn-walk/dist/walk.d.mts +152 -0
  380. package/test/node_modules/acorn-walk/dist/walk.d.ts +152 -0
  381. package/test/node_modules/acorn-walk/dist/walk.js +485 -0
  382. package/test/node_modules/acorn-walk/dist/walk.mjs +467 -0
  383. package/test/node_modules/acorn-walk/node_modules/.bin/acorn +15 -0
  384. package/test/node_modules/acorn-walk/node_modules/.bin/acorn.cmd +7 -0
  385. package/test/node_modules/acorn-walk/package.json +50 -0
  386. package/test/node_modules/ansi-regex/index.d.ts +37 -0
  387. package/test/node_modules/ansi-regex/index.js +10 -0
  388. package/test/node_modules/ansi-regex/license +9 -0
  389. package/test/node_modules/ansi-regex/package.json +55 -0
  390. package/test/node_modules/ansi-regex/readme.md +78 -0
  391. package/test/node_modules/ansi-styles/index.d.ts +345 -0
  392. package/test/node_modules/ansi-styles/index.js +163 -0
  393. package/test/node_modules/ansi-styles/license +9 -0
  394. package/test/node_modules/ansi-styles/package.json +56 -0
  395. package/test/node_modules/ansi-styles/readme.md +152 -0
  396. package/test/node_modules/arg/LICENSE.md +21 -0
  397. package/test/node_modules/arg/README.md +280 -0
  398. package/test/node_modules/arg/index.d.ts +31 -0
  399. package/test/node_modules/arg/index.js +144 -0
  400. package/test/node_modules/arg/package.json +30 -0
  401. package/test/node_modules/chalk/index.d.ts +415 -0
  402. package/test/node_modules/chalk/license +9 -0
  403. package/test/node_modules/chalk/package.json +68 -0
  404. package/test/node_modules/chalk/readme.md +341 -0
  405. package/test/node_modules/chalk/source/index.js +229 -0
  406. package/test/node_modules/chalk/source/templates.js +134 -0
  407. package/test/node_modules/chalk/source/util.js +39 -0
  408. package/test/node_modules/color-convert/CHANGELOG.md +54 -0
  409. package/test/node_modules/color-convert/LICENSE +21 -0
  410. package/test/node_modules/color-convert/README.md +68 -0
  411. package/test/node_modules/color-convert/conversions.js +839 -0
  412. package/test/node_modules/color-convert/index.js +81 -0
  413. package/test/node_modules/color-convert/package.json +48 -0
  414. package/test/node_modules/color-convert/route.js +97 -0
  415. package/test/node_modules/color-name/LICENSE +8 -0
  416. package/test/node_modules/color-name/README.md +11 -0
  417. package/test/node_modules/color-name/index.js +152 -0
  418. package/test/node_modules/color-name/package.json +28 -0
  419. package/test/node_modules/create-require/CHANGELOG.md +33 -0
  420. package/test/node_modules/create-require/LICENSE +25 -0
  421. package/test/node_modules/create-require/README.md +46 -0
  422. package/test/node_modules/create-require/create-require.d.ts +3 -0
  423. package/test/node_modules/create-require/create-require.js +49 -0
  424. package/test/node_modules/create-require/package.json +39 -0
  425. package/test/node_modules/diff/CONTRIBUTING.md +39 -0
  426. package/test/node_modules/diff/LICENSE +31 -0
  427. package/test/node_modules/diff/README.md +207 -0
  428. package/test/node_modules/diff/dist/diff.js +1548 -0
  429. package/test/node_modules/diff/dist/diff.min.js +1 -0
  430. package/test/node_modules/diff/lib/convert/dmp.js +32 -0
  431. package/test/node_modules/diff/lib/convert/xml.js +42 -0
  432. package/test/node_modules/diff/lib/diff/array.js +45 -0
  433. package/test/node_modules/diff/lib/diff/base.js +304 -0
  434. package/test/node_modules/diff/lib/diff/character.js +37 -0
  435. package/test/node_modules/diff/lib/diff/css.js +41 -0
  436. package/test/node_modules/diff/lib/diff/json.js +163 -0
  437. package/test/node_modules/diff/lib/diff/line.js +89 -0
  438. package/test/node_modules/diff/lib/diff/sentence.js +41 -0
  439. package/test/node_modules/diff/lib/diff/word.js +107 -0
  440. package/test/node_modules/diff/lib/index.es6.js +1519 -0
  441. package/test/node_modules/diff/lib/index.js +216 -0
  442. package/test/node_modules/diff/lib/patch/apply.js +243 -0
  443. package/test/node_modules/diff/lib/patch/create.js +247 -0
  444. package/test/node_modules/diff/lib/patch/merge.js +609 -0
  445. package/test/node_modules/diff/lib/patch/parse.js +156 -0
  446. package/test/node_modules/diff/lib/util/array.js +32 -0
  447. package/test/node_modules/diff/lib/util/distance-iterator.js +57 -0
  448. package/test/node_modules/diff/lib/util/params.js +24 -0
  449. package/test/node_modules/diff/package.json +74 -0
  450. package/test/node_modules/diff/release-notes.md +261 -0
  451. package/test/node_modules/diff/runtime.js +3 -0
  452. package/test/node_modules/fs-extra/LICENSE +15 -0
  453. package/test/node_modules/fs-extra/README.md +262 -0
  454. package/test/node_modules/fs-extra/lib/copy/copy-sync.js +169 -0
  455. package/test/node_modules/fs-extra/lib/copy/copy.js +235 -0
  456. package/test/node_modules/fs-extra/lib/copy/index.js +7 -0
  457. package/test/node_modules/fs-extra/lib/empty/index.js +39 -0
  458. package/test/node_modules/fs-extra/lib/ensure/file.js +69 -0
  459. package/test/node_modules/fs-extra/lib/ensure/index.js +23 -0
  460. package/test/node_modules/fs-extra/lib/ensure/link.js +64 -0
  461. package/test/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
  462. package/test/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
  463. package/test/node_modules/fs-extra/lib/ensure/symlink.js +82 -0
  464. package/test/node_modules/fs-extra/lib/fs/index.js +128 -0
  465. package/test/node_modules/fs-extra/lib/index.js +16 -0
  466. package/test/node_modules/fs-extra/lib/json/index.js +16 -0
  467. package/test/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
  468. package/test/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
  469. package/test/node_modules/fs-extra/lib/json/output-json.js +12 -0
  470. package/test/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
  471. package/test/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
  472. package/test/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
  473. package/test/node_modules/fs-extra/lib/move/index.js +7 -0
  474. package/test/node_modules/fs-extra/lib/move/move-sync.js +54 -0
  475. package/test/node_modules/fs-extra/lib/move/move.js +75 -0
  476. package/test/node_modules/fs-extra/lib/output-file/index.js +40 -0
  477. package/test/node_modules/fs-extra/lib/path-exists/index.js +12 -0
  478. package/test/node_modules/fs-extra/lib/remove/index.js +22 -0
  479. package/test/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
  480. package/test/node_modules/fs-extra/lib/util/stat.js +154 -0
  481. package/test/node_modules/fs-extra/lib/util/utimes.js +26 -0
  482. package/test/node_modules/fs-extra/package.json +67 -0
  483. package/test/node_modules/function-bind/.eslintrc +21 -0
  484. package/test/node_modules/function-bind/.github/FUNDING.yml +12 -0
  485. package/test/node_modules/function-bind/.github/SECURITY.md +3 -0
  486. package/test/node_modules/function-bind/.nycrc +13 -0
  487. package/test/node_modules/function-bind/CHANGELOG.md +136 -0
  488. package/test/node_modules/function-bind/LICENSE +20 -0
  489. package/test/node_modules/function-bind/README.md +46 -0
  490. package/test/node_modules/function-bind/implementation.js +84 -0
  491. package/test/node_modules/function-bind/index.js +5 -0
  492. package/test/node_modules/function-bind/package.json +87 -0
  493. package/test/node_modules/function-bind/test/.eslintrc +9 -0
  494. package/test/node_modules/function-bind/test/index.js +252 -0
  495. package/test/node_modules/global-prefix/LICENSE +21 -0
  496. package/test/node_modules/global-prefix/README.md +92 -0
  497. package/test/node_modules/global-prefix/index.js +85 -0
  498. package/test/node_modules/global-prefix/node_modules/.bin/node-which +15 -0
  499. package/test/node_modules/global-prefix/node_modules/.bin/node-which.cmd +7 -0
  500. package/test/node_modules/global-prefix/package.json +49 -0
  501. package/test/node_modules/graceful-fs/LICENSE +15 -0
  502. package/test/node_modules/graceful-fs/README.md +143 -0
  503. package/test/node_modules/graceful-fs/clone.js +23 -0
  504. package/test/node_modules/graceful-fs/graceful-fs.js +448 -0
  505. package/test/node_modules/graceful-fs/legacy-streams.js +118 -0
  506. package/test/node_modules/graceful-fs/package.json +53 -0
  507. package/test/node_modules/graceful-fs/polyfills.js +355 -0
  508. package/test/node_modules/has-flag/index.d.ts +39 -0
  509. package/test/node_modules/has-flag/index.js +8 -0
  510. package/test/node_modules/has-flag/license +9 -0
  511. package/test/node_modules/has-flag/package.json +46 -0
  512. package/test/node_modules/has-flag/readme.md +89 -0
  513. package/test/node_modules/hasown/.eslintrc +5 -0
  514. package/test/node_modules/hasown/.github/FUNDING.yml +12 -0
  515. package/test/node_modules/hasown/.nycrc +13 -0
  516. package/test/node_modules/hasown/CHANGELOG.md +40 -0
  517. package/test/node_modules/hasown/LICENSE +21 -0
  518. package/test/node_modules/hasown/README.md +40 -0
  519. package/test/node_modules/hasown/index.d.ts +3 -0
  520. package/test/node_modules/hasown/index.js +8 -0
  521. package/test/node_modules/hasown/package.json +92 -0
  522. package/test/node_modules/hasown/tsconfig.json +6 -0
  523. package/test/node_modules/ini/LICENSE +15 -0
  524. package/test/node_modules/ini/README.md +180 -0
  525. package/test/node_modules/ini/lib/ini.js +280 -0
  526. package/test/node_modules/ini/package.json +45 -0
  527. package/test/node_modules/is-core-module/.eslintrc +18 -0
  528. package/test/node_modules/is-core-module/.nycrc +9 -0
  529. package/test/node_modules/is-core-module/CHANGELOG.md +218 -0
  530. package/test/node_modules/is-core-module/LICENSE +20 -0
  531. package/test/node_modules/is-core-module/README.md +40 -0
  532. package/test/node_modules/is-core-module/core.json +162 -0
  533. package/test/node_modules/is-core-module/index.js +69 -0
  534. package/test/node_modules/is-core-module/package.json +76 -0
  535. package/test/node_modules/is-core-module/test/index.js +157 -0
  536. package/test/node_modules/isexe/LICENSE.md +55 -0
  537. package/test/node_modules/isexe/README.md +80 -0
  538. package/test/node_modules/isexe/dist/commonjs/index.d.ts +14 -0
  539. package/test/node_modules/isexe/dist/commonjs/index.d.ts.map +1 -0
  540. package/test/node_modules/isexe/dist/commonjs/index.js +56 -0
  541. package/test/node_modules/isexe/dist/commonjs/index.js.map +1 -0
  542. package/test/node_modules/isexe/dist/commonjs/index.min.js +2 -0
  543. package/test/node_modules/isexe/dist/commonjs/index.min.js.map +7 -0
  544. package/test/node_modules/isexe/dist/commonjs/options.d.ts +32 -0
  545. package/test/node_modules/isexe/dist/commonjs/options.d.ts.map +1 -0
  546. package/test/node_modules/isexe/dist/commonjs/options.js +3 -0
  547. package/test/node_modules/isexe/dist/commonjs/options.js.map +1 -0
  548. package/test/node_modules/isexe/dist/commonjs/package.json +3 -0
  549. package/test/node_modules/isexe/dist/commonjs/posix.d.ts +18 -0
  550. package/test/node_modules/isexe/dist/commonjs/posix.d.ts.map +1 -0
  551. package/test/node_modules/isexe/dist/commonjs/posix.js +67 -0
  552. package/test/node_modules/isexe/dist/commonjs/posix.js.map +1 -0
  553. package/test/node_modules/isexe/dist/commonjs/win32.d.ts +18 -0
  554. package/test/node_modules/isexe/dist/commonjs/win32.d.ts.map +1 -0
  555. package/test/node_modules/isexe/dist/commonjs/win32.js +63 -0
  556. package/test/node_modules/isexe/dist/commonjs/win32.js.map +1 -0
  557. package/test/node_modules/isexe/dist/esm/index.d.ts +14 -0
  558. package/test/node_modules/isexe/dist/esm/index.d.ts.map +1 -0
  559. package/test/node_modules/isexe/dist/esm/index.js +16 -0
  560. package/test/node_modules/isexe/dist/esm/index.js.map +1 -0
  561. package/test/node_modules/isexe/dist/esm/index.min.js +2 -0
  562. package/test/node_modules/isexe/dist/esm/index.min.js.map +7 -0
  563. package/test/node_modules/isexe/dist/esm/options.d.ts +32 -0
  564. package/test/node_modules/isexe/dist/esm/options.d.ts.map +1 -0
  565. package/test/node_modules/isexe/dist/esm/options.js +2 -0
  566. package/test/node_modules/isexe/dist/esm/options.js.map +1 -0
  567. package/test/node_modules/isexe/dist/esm/package.json +3 -0
  568. package/test/node_modules/isexe/dist/esm/posix.d.ts +18 -0
  569. package/test/node_modules/isexe/dist/esm/posix.d.ts.map +1 -0
  570. package/test/node_modules/isexe/dist/esm/posix.js +62 -0
  571. package/test/node_modules/isexe/dist/esm/posix.js.map +1 -0
  572. package/test/node_modules/isexe/dist/esm/win32.d.ts +18 -0
  573. package/test/node_modules/isexe/dist/esm/win32.d.ts.map +1 -0
  574. package/test/node_modules/isexe/dist/esm/win32.js +58 -0
  575. package/test/node_modules/isexe/dist/esm/win32.js.map +1 -0
  576. package/test/node_modules/isexe/package.json +78 -0
  577. package/test/node_modules/json5/LICENSE.md +23 -0
  578. package/test/node_modules/json5/README.md +282 -0
  579. package/test/node_modules/json5/dist/index.js +1737 -0
  580. package/test/node_modules/json5/dist/index.min.js +1 -0
  581. package/test/node_modules/json5/dist/index.min.mjs +1 -0
  582. package/test/node_modules/json5/dist/index.mjs +1426 -0
  583. package/test/node_modules/json5/lib/cli.js +152 -0
  584. package/test/node_modules/json5/lib/index.d.ts +4 -0
  585. package/test/node_modules/json5/lib/index.js +9 -0
  586. package/test/node_modules/json5/lib/parse.d.ts +15 -0
  587. package/test/node_modules/json5/lib/parse.js +1114 -0
  588. package/test/node_modules/json5/lib/register.js +13 -0
  589. package/test/node_modules/json5/lib/require.js +4 -0
  590. package/test/node_modules/json5/lib/stringify.d.ts +89 -0
  591. package/test/node_modules/json5/lib/stringify.js +261 -0
  592. package/test/node_modules/json5/lib/unicode.d.ts +3 -0
  593. package/test/node_modules/json5/lib/unicode.js +4 -0
  594. package/test/node_modules/json5/lib/util.d.ts +5 -0
  595. package/test/node_modules/json5/lib/util.js +35 -0
  596. package/test/node_modules/json5/package.json +72 -0
  597. package/test/node_modules/jsonfile/LICENSE +15 -0
  598. package/test/node_modules/jsonfile/README.md +230 -0
  599. package/test/node_modules/jsonfile/index.js +88 -0
  600. package/test/node_modules/jsonfile/package.json +40 -0
  601. package/test/node_modules/jsonfile/utils.js +14 -0
  602. package/test/node_modules/kind-of/CHANGELOG.md +160 -0
  603. package/test/node_modules/kind-of/LICENSE +21 -0
  604. package/test/node_modules/kind-of/README.md +367 -0
  605. package/test/node_modules/kind-of/index.js +129 -0
  606. package/test/node_modules/kind-of/package.json +88 -0
  607. package/test/node_modules/make-error/LICENSE +5 -0
  608. package/test/node_modules/make-error/README.md +112 -0
  609. package/test/node_modules/make-error/dist/make-error.js +1 -0
  610. package/test/node_modules/make-error/index.d.ts +47 -0
  611. package/test/node_modules/make-error/index.js +151 -0
  612. package/test/node_modules/make-error/package.json +62 -0
  613. package/test/node_modules/minimist/.eslintrc +29 -0
  614. package/test/node_modules/minimist/.github/FUNDING.yml +12 -0
  615. package/test/node_modules/minimist/.nycrc +14 -0
  616. package/test/node_modules/minimist/CHANGELOG.md +298 -0
  617. package/test/node_modules/minimist/LICENSE +18 -0
  618. package/test/node_modules/minimist/README.md +121 -0
  619. package/test/node_modules/minimist/example/parse.js +4 -0
  620. package/test/node_modules/minimist/index.js +263 -0
  621. package/test/node_modules/minimist/package.json +75 -0
  622. package/test/node_modules/minimist/test/all_bool.js +34 -0
  623. package/test/node_modules/minimist/test/bool.js +177 -0
  624. package/test/node_modules/minimist/test/dash.js +43 -0
  625. package/test/node_modules/minimist/test/default_bool.js +37 -0
  626. package/test/node_modules/minimist/test/dotted.js +24 -0
  627. package/test/node_modules/minimist/test/kv_short.js +32 -0
  628. package/test/node_modules/minimist/test/long.js +33 -0
  629. package/test/node_modules/minimist/test/num.js +38 -0
  630. package/test/node_modules/minimist/test/parse.js +209 -0
  631. package/test/node_modules/minimist/test/parse_modified.js +11 -0
  632. package/test/node_modules/minimist/test/proto.js +64 -0
  633. package/test/node_modules/minimist/test/short.js +69 -0
  634. package/test/node_modules/minimist/test/stop_early.js +17 -0
  635. package/test/node_modules/minimist/test/unknown.js +104 -0
  636. package/test/node_modules/minimist/test/whitespace.js +10 -0
  637. package/test/node_modules/path-parse/LICENSE +21 -0
  638. package/test/node_modules/path-parse/README.md +42 -0
  639. package/test/node_modules/path-parse/index.js +75 -0
  640. package/test/node_modules/path-parse/package.json +33 -0
  641. package/test/node_modules/resolve/.editorconfig +37 -0
  642. package/test/node_modules/resolve/.eslintrc +65 -0
  643. package/test/node_modules/resolve/.github/FUNDING.yml +12 -0
  644. package/test/node_modules/resolve/.github/INCIDENT_RESPONSE_PROCESS.md +119 -0
  645. package/test/node_modules/resolve/.github/THREAT_MODEL.md +74 -0
  646. package/test/node_modules/resolve/LICENSE +21 -0
  647. package/test/node_modules/resolve/SECURITY.md +11 -0
  648. package/test/node_modules/resolve/async.js +3 -0
  649. package/test/node_modules/resolve/bin/resolve +50 -0
  650. package/test/node_modules/resolve/example/async.js +5 -0
  651. package/test/node_modules/resolve/example/sync.js +3 -0
  652. package/test/node_modules/resolve/index.js +6 -0
  653. package/test/node_modules/resolve/lib/async.js +333 -0
  654. package/test/node_modules/resolve/lib/caller.js +8 -0
  655. package/test/node_modules/resolve/lib/core.js +12 -0
  656. package/test/node_modules/resolve/lib/core.json +162 -0
  657. package/test/node_modules/resolve/lib/homedir.js +24 -0
  658. package/test/node_modules/resolve/lib/is-core.js +5 -0
  659. package/test/node_modules/resolve/lib/node-modules-paths.js +45 -0
  660. package/test/node_modules/resolve/lib/normalize-options.js +10 -0
  661. package/test/node_modules/resolve/lib/sync.js +212 -0
  662. package/test/node_modules/resolve/package.json +75 -0
  663. package/test/node_modules/resolve/readme.markdown +301 -0
  664. package/test/node_modules/resolve/sync.js +3 -0
  665. package/test/node_modules/resolve/test/core.js +88 -0
  666. package/test/node_modules/resolve/test/dotdot/abc/index.js +2 -0
  667. package/test/node_modules/resolve/test/dotdot/index.js +1 -0
  668. package/test/node_modules/resolve/test/dotdot.js +29 -0
  669. package/test/node_modules/resolve/test/faulty_basedir.js +29 -0
  670. package/test/node_modules/resolve/test/filter.js +34 -0
  671. package/test/node_modules/resolve/test/filter_sync.js +33 -0
  672. package/test/node_modules/resolve/test/home_paths.js +127 -0
  673. package/test/node_modules/resolve/test/home_paths_sync.js +114 -0
  674. package/test/node_modules/resolve/test/mock.js +315 -0
  675. package/test/node_modules/resolve/test/mock_sync.js +214 -0
  676. package/test/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +1 -0
  677. package/test/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +1 -0
  678. package/test/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +1 -0
  679. package/test/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +3 -0
  680. package/test/node_modules/resolve/test/module_dir.js +56 -0
  681. package/test/node_modules/resolve/test/node-modules-paths.js +143 -0
  682. package/test/node_modules/resolve/test/node_path/x/aaa/index.js +1 -0
  683. package/test/node_modules/resolve/test/node_path/x/ccc/index.js +1 -0
  684. package/test/node_modules/resolve/test/node_path/y/bbb/index.js +1 -0
  685. package/test/node_modules/resolve/test/node_path/y/ccc/index.js +1 -0
  686. package/test/node_modules/resolve/test/node_path.js +70 -0
  687. package/test/node_modules/resolve/test/nonstring.js +9 -0
  688. package/test/node_modules/resolve/test/pathfilter/deep_ref/main.js +0 -0
  689. package/test/node_modules/resolve/test/pathfilter.js +75 -0
  690. package/test/node_modules/resolve/test/precedence/aaa/index.js +1 -0
  691. package/test/node_modules/resolve/test/precedence/aaa/main.js +1 -0
  692. package/test/node_modules/resolve/test/precedence/aaa.js +1 -0
  693. package/test/node_modules/resolve/test/precedence/bbb/main.js +1 -0
  694. package/test/node_modules/resolve/test/precedence/bbb.js +1 -0
  695. package/test/node_modules/resolve/test/precedence.js +23 -0
  696. package/test/node_modules/resolve/test/resolver/baz/doom.js +0 -0
  697. package/test/node_modules/resolve/test/resolver/baz/package.json +4 -0
  698. package/test/node_modules/resolve/test/resolver/baz/quux.js +1 -0
  699. package/test/node_modules/resolve/test/resolver/browser_field/a.js +0 -0
  700. package/test/node_modules/resolve/test/resolver/browser_field/b.js +0 -0
  701. package/test/node_modules/resolve/test/resolver/browser_field/package.json +5 -0
  702. package/test/node_modules/resolve/test/resolver/cup.coffee +1 -0
  703. package/test/node_modules/resolve/test/resolver/dot_main/index.js +1 -0
  704. package/test/node_modules/resolve/test/resolver/dot_main/package.json +3 -0
  705. package/test/node_modules/resolve/test/resolver/dot_slash_main/index.js +1 -0
  706. package/test/node_modules/resolve/test/resolver/dot_slash_main/package.json +3 -0
  707. package/test/node_modules/resolve/test/resolver/false_main/index.js +0 -0
  708. package/test/node_modules/resolve/test/resolver/false_main/package.json +4 -0
  709. package/test/node_modules/resolve/test/resolver/foo.js +1 -0
  710. package/test/node_modules/resolve/test/resolver/incorrect_main/index.js +2 -0
  711. package/test/node_modules/resolve/test/resolver/incorrect_main/package.json +3 -0
  712. package/test/node_modules/resolve/test/resolver/invalid_main/package.json +7 -0
  713. package/test/node_modules/resolve/test/resolver/mug.coffee +0 -0
  714. package/test/node_modules/resolve/test/resolver/mug.js +0 -0
  715. package/test/node_modules/resolve/test/resolver/multirepo/lerna.json +6 -0
  716. package/test/node_modules/resolve/test/resolver/multirepo/package.json +20 -0
  717. package/test/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js +35 -0
  718. package/test/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json +14 -0
  719. package/test/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js +0 -0
  720. package/test/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json +14 -0
  721. package/test/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +26 -0
  722. package/test/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json +15 -0
  723. package/test/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js +12 -0
  724. package/test/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
  725. package/test/node_modules/resolve/test/resolver/other_path/root.js +0 -0
  726. package/test/node_modules/resolve/test/resolver/quux/foo/index.js +1 -0
  727. package/test/node_modules/resolve/test/resolver/same_names/foo/index.js +1 -0
  728. package/test/node_modules/resolve/test/resolver/same_names/foo.js +1 -0
  729. package/test/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js +0 -0
  730. package/test/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep +0 -0
  731. package/test/node_modules/resolve/test/resolver/symlinked/package/bar.js +1 -0
  732. package/test/node_modules/resolve/test/resolver/symlinked/package/package.json +3 -0
  733. package/test/node_modules/resolve/test/resolver/without_basedir/main.js +5 -0
  734. package/test/node_modules/resolve/test/resolver.js +597 -0
  735. package/test/node_modules/resolve/test/resolver_sync.js +730 -0
  736. package/test/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
  737. package/test/node_modules/resolve/test/shadowed_core.js +54 -0
  738. package/test/node_modules/resolve/test/subdirs.js +13 -0
  739. package/test/node_modules/resolve/test/symlinks.js +176 -0
  740. package/test/node_modules/semver/LICENSE +15 -0
  741. package/test/node_modules/semver/README.md +665 -0
  742. package/test/node_modules/semver/bin/semver.js +191 -0
  743. package/test/node_modules/semver/classes/comparator.js +143 -0
  744. package/test/node_modules/semver/classes/index.js +7 -0
  745. package/test/node_modules/semver/classes/range.js +557 -0
  746. package/test/node_modules/semver/classes/semver.js +333 -0
  747. package/test/node_modules/semver/functions/clean.js +8 -0
  748. package/test/node_modules/semver/functions/cmp.js +54 -0
  749. package/test/node_modules/semver/functions/coerce.js +62 -0
  750. package/test/node_modules/semver/functions/compare-build.js +9 -0
  751. package/test/node_modules/semver/functions/compare-loose.js +5 -0
  752. package/test/node_modules/semver/functions/compare.js +7 -0
  753. package/test/node_modules/semver/functions/diff.js +60 -0
  754. package/test/node_modules/semver/functions/eq.js +5 -0
  755. package/test/node_modules/semver/functions/gt.js +5 -0
  756. package/test/node_modules/semver/functions/gte.js +5 -0
  757. package/test/node_modules/semver/functions/inc.js +21 -0
  758. package/test/node_modules/semver/functions/lt.js +5 -0
  759. package/test/node_modules/semver/functions/lte.js +5 -0
  760. package/test/node_modules/semver/functions/major.js +5 -0
  761. package/test/node_modules/semver/functions/minor.js +5 -0
  762. package/test/node_modules/semver/functions/neq.js +5 -0
  763. package/test/node_modules/semver/functions/parse.js +18 -0
  764. package/test/node_modules/semver/functions/patch.js +5 -0
  765. package/test/node_modules/semver/functions/prerelease.js +8 -0
  766. package/test/node_modules/semver/functions/rcompare.js +5 -0
  767. package/test/node_modules/semver/functions/rsort.js +5 -0
  768. package/test/node_modules/semver/functions/satisfies.js +12 -0
  769. package/test/node_modules/semver/functions/sort.js +5 -0
  770. package/test/node_modules/semver/functions/valid.js +8 -0
  771. package/test/node_modules/semver/index.js +91 -0
  772. package/test/node_modules/semver/internal/constants.js +37 -0
  773. package/test/node_modules/semver/internal/debug.js +11 -0
  774. package/test/node_modules/semver/internal/identifiers.js +29 -0
  775. package/test/node_modules/semver/internal/lrucache.js +42 -0
  776. package/test/node_modules/semver/internal/parse-options.js +17 -0
  777. package/test/node_modules/semver/internal/re.js +223 -0
  778. package/test/node_modules/semver/package.json +78 -0
  779. package/test/node_modules/semver/preload.js +4 -0
  780. package/test/node_modules/semver/range.bnf +16 -0
  781. package/test/node_modules/semver/ranges/gtr.js +6 -0
  782. package/test/node_modules/semver/ranges/intersects.js +9 -0
  783. package/test/node_modules/semver/ranges/ltr.js +6 -0
  784. package/test/node_modules/semver/ranges/max-satisfying.js +27 -0
  785. package/test/node_modules/semver/ranges/min-satisfying.js +26 -0
  786. package/test/node_modules/semver/ranges/min-version.js +63 -0
  787. package/test/node_modules/semver/ranges/outside.js +82 -0
  788. package/test/node_modules/semver/ranges/simplify.js +49 -0
  789. package/test/node_modules/semver/ranges/subset.js +249 -0
  790. package/test/node_modules/semver/ranges/to-comparators.js +10 -0
  791. package/test/node_modules/semver/ranges/valid.js +13 -0
  792. package/test/node_modules/strip-ansi/index.d.ts +17 -0
  793. package/test/node_modules/strip-ansi/index.js +4 -0
  794. package/test/node_modules/strip-ansi/license +9 -0
  795. package/test/node_modules/strip-ansi/package.json +54 -0
  796. package/test/node_modules/strip-ansi/readme.md +46 -0
  797. package/test/node_modules/strip-bom/index.js +14 -0
  798. package/test/node_modules/strip-bom/license +21 -0
  799. package/test/node_modules/strip-bom/package.json +40 -0
  800. package/test/node_modules/strip-bom/readme.md +36 -0
  801. package/test/node_modules/supports-color/browser.js +5 -0
  802. package/test/node_modules/supports-color/index.js +135 -0
  803. package/test/node_modules/supports-color/license +9 -0
  804. package/test/node_modules/supports-color/package.json +53 -0
  805. package/test/node_modules/supports-color/readme.md +76 -0
  806. package/test/node_modules/supports-preserve-symlinks-flag/.eslintrc +14 -0
  807. package/test/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +12 -0
  808. package/test/node_modules/supports-preserve-symlinks-flag/.nycrc +9 -0
  809. package/test/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +22 -0
  810. package/test/node_modules/supports-preserve-symlinks-flag/LICENSE +21 -0
  811. package/test/node_modules/supports-preserve-symlinks-flag/README.md +42 -0
  812. package/test/node_modules/supports-preserve-symlinks-flag/browser.js +3 -0
  813. package/test/node_modules/supports-preserve-symlinks-flag/index.js +9 -0
  814. package/test/node_modules/supports-preserve-symlinks-flag/package.json +70 -0
  815. package/test/node_modules/supports-preserve-symlinks-flag/test/index.js +29 -0
  816. package/test/node_modules/ts-latest/LICENSE.txt +55 -0
  817. package/test/node_modules/ts-latest/README.md +50 -0
  818. package/test/node_modules/ts-latest/SECURITY.md +39 -0
  819. package/test/node_modules/ts-latest/ThirdPartyNoticeText.txt +193 -0
  820. package/test/node_modules/ts-latest/bin/tsc +2 -0
  821. package/test/node_modules/ts-latest/bin/tsserver +2 -0
  822. package/test/node_modules/ts-latest/lib/_tsc.js +134440 -0
  823. package/test/node_modules/ts-latest/lib/_tsserver.js +659 -0
  824. package/test/node_modules/ts-latest/lib/_typingsInstaller.js +222 -0
  825. package/test/node_modules/ts-latest/lib/cs/diagnosticMessages.generated.json +2129 -0
  826. package/test/node_modules/ts-latest/lib/de/diagnosticMessages.generated.json +2125 -0
  827. package/test/node_modules/ts-latest/lib/es/diagnosticMessages.generated.json +2129 -0
  828. package/test/node_modules/ts-latest/lib/fr/diagnosticMessages.generated.json +2129 -0
  829. package/test/node_modules/ts-latest/lib/it/diagnosticMessages.generated.json +2125 -0
  830. package/test/node_modules/ts-latest/lib/ja/diagnosticMessages.generated.json +2129 -0
  831. package/test/node_modules/ts-latest/lib/ko/diagnosticMessages.generated.json +2129 -0
  832. package/test/node_modules/ts-latest/lib/lib.d.ts +20 -0
  833. package/test/node_modules/ts-latest/lib/lib.decorators.d.ts +382 -0
  834. package/test/node_modules/ts-latest/lib/lib.decorators.legacy.d.ts +20 -0
  835. package/test/node_modules/ts-latest/lib/lib.dom.asynciterable.d.ts +18 -0
  836. package/test/node_modules/ts-latest/lib/lib.dom.d.ts +44303 -0
  837. package/test/node_modules/ts-latest/lib/lib.dom.iterable.d.ts +18 -0
  838. package/test/node_modules/ts-latest/lib/lib.es2015.collection.d.ts +150 -0
  839. package/test/node_modules/ts-latest/lib/lib.es2015.core.d.ts +595 -0
  840. package/test/node_modules/ts-latest/lib/lib.es2015.d.ts +26 -0
  841. package/test/node_modules/ts-latest/lib/lib.es2015.generator.d.ts +75 -0
  842. package/test/node_modules/ts-latest/lib/lib.es2015.iterable.d.ts +603 -0
  843. package/test/node_modules/ts-latest/lib/lib.es2015.promise.d.ts +79 -0
  844. package/test/node_modules/ts-latest/lib/lib.es2015.proxy.d.ts +126 -0
  845. package/test/node_modules/ts-latest/lib/lib.es2015.reflect.d.ts +142 -0
  846. package/test/node_modules/ts-latest/lib/lib.es2015.symbol.d.ts +44 -0
  847. package/test/node_modules/ts-latest/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
  848. package/test/node_modules/ts-latest/lib/lib.es2016.array.include.d.ts +114 -0
  849. package/test/node_modules/ts-latest/lib/lib.es2016.d.ts +19 -0
  850. package/test/node_modules/ts-latest/lib/lib.es2016.full.d.ts +21 -0
  851. package/test/node_modules/ts-latest/lib/lib.es2016.intl.d.ts +29 -0
  852. package/test/node_modules/ts-latest/lib/lib.es2017.arraybuffer.d.ts +19 -0
  853. package/test/node_modules/ts-latest/lib/lib.es2017.d.ts +24 -0
  854. package/test/node_modules/ts-latest/lib/lib.es2017.date.d.ts +29 -0
  855. package/test/node_modules/ts-latest/lib/lib.es2017.full.d.ts +21 -0
  856. package/test/node_modules/ts-latest/lib/lib.es2017.intl.d.ts +42 -0
  857. package/test/node_modules/ts-latest/lib/lib.es2017.object.d.ts +47 -0
  858. package/test/node_modules/ts-latest/lib/lib.es2017.sharedmemory.d.ts +133 -0
  859. package/test/node_modules/ts-latest/lib/lib.es2017.string.d.ts +43 -0
  860. package/test/node_modules/ts-latest/lib/lib.es2017.typedarrays.d.ts +51 -0
  861. package/test/node_modules/ts-latest/lib/lib.es2018.asyncgenerator.d.ts +75 -0
  862. package/test/node_modules/ts-latest/lib/lib.es2018.asynciterable.d.ts +51 -0
  863. package/test/node_modules/ts-latest/lib/lib.es2018.d.ts +22 -0
  864. package/test/node_modules/ts-latest/lib/lib.es2018.full.d.ts +22 -0
  865. package/test/node_modules/ts-latest/lib/lib.es2018.intl.d.ts +81 -0
  866. package/test/node_modules/ts-latest/lib/lib.es2018.promise.d.ts +28 -0
  867. package/test/node_modules/ts-latest/lib/lib.es2018.regexp.d.ts +35 -0
  868. package/test/node_modules/ts-latest/lib/lib.es2019.array.d.ts +77 -0
  869. package/test/node_modules/ts-latest/lib/lib.es2019.d.ts +22 -0
  870. package/test/node_modules/ts-latest/lib/lib.es2019.full.d.ts +22 -0
  871. package/test/node_modules/ts-latest/lib/lib.es2019.intl.d.ts +21 -0
  872. package/test/node_modules/ts-latest/lib/lib.es2019.object.d.ts +31 -0
  873. package/test/node_modules/ts-latest/lib/lib.es2019.string.d.ts +35 -0
  874. package/test/node_modules/ts-latest/lib/lib.es2019.symbol.d.ts +22 -0
  875. package/test/node_modules/ts-latest/lib/lib.es2020.bigint.d.ts +763 -0
  876. package/test/node_modules/ts-latest/lib/lib.es2020.d.ts +25 -0
  877. package/test/node_modules/ts-latest/lib/lib.es2020.date.d.ts +40 -0
  878. package/test/node_modules/ts-latest/lib/lib.es2020.full.d.ts +22 -0
  879. package/test/node_modules/ts-latest/lib/lib.es2020.intl.d.ts +472 -0
  880. package/test/node_modules/ts-latest/lib/lib.es2020.number.d.ts +26 -0
  881. package/test/node_modules/ts-latest/lib/lib.es2020.promise.d.ts +45 -0
  882. package/test/node_modules/ts-latest/lib/lib.es2020.sharedmemory.d.ts +97 -0
  883. package/test/node_modules/ts-latest/lib/lib.es2020.string.d.ts +42 -0
  884. package/test/node_modules/ts-latest/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
  885. package/test/node_modules/ts-latest/lib/lib.es2021.d.ts +21 -0
  886. package/test/node_modules/ts-latest/lib/lib.es2021.full.d.ts +22 -0
  887. package/test/node_modules/ts-latest/lib/lib.es2021.intl.d.ts +164 -0
  888. package/test/node_modules/ts-latest/lib/lib.es2021.promise.d.ts +46 -0
  889. package/test/node_modules/ts-latest/lib/lib.es2021.string.d.ts +31 -0
  890. package/test/node_modules/ts-latest/lib/lib.es2021.weakref.d.ts +76 -0
  891. package/test/node_modules/ts-latest/lib/lib.es2022.array.d.ts +119 -0
  892. package/test/node_modules/ts-latest/lib/lib.es2022.d.ts +23 -0
  893. package/test/node_modules/ts-latest/lib/lib.es2022.error.d.ts +73 -0
  894. package/test/node_modules/ts-latest/lib/lib.es2022.full.d.ts +22 -0
  895. package/test/node_modules/ts-latest/lib/lib.es2022.intl.d.ts +143 -0
  896. package/test/node_modules/ts-latest/lib/lib.es2022.object.d.ts +24 -0
  897. package/test/node_modules/ts-latest/lib/lib.es2022.regexp.d.ts +37 -0
  898. package/test/node_modules/ts-latest/lib/lib.es2022.string.d.ts +23 -0
  899. package/test/node_modules/ts-latest/lib/lib.es2023.array.d.ts +922 -0
  900. package/test/node_modules/ts-latest/lib/lib.es2023.collection.d.ts +19 -0
  901. package/test/node_modules/ts-latest/lib/lib.es2023.d.ts +20 -0
  902. package/test/node_modules/ts-latest/lib/lib.es2023.full.d.ts +22 -0
  903. package/test/node_modules/ts-latest/lib/lib.es2023.intl.d.ts +62 -0
  904. package/test/node_modules/ts-latest/lib/lib.es2024.arraybuffer.d.ts +63 -0
  905. package/test/node_modules/ts-latest/lib/lib.es2024.collection.d.ts +27 -0
  906. package/test/node_modules/ts-latest/lib/lib.es2024.d.ts +24 -0
  907. package/test/node_modules/ts-latest/lib/lib.es2024.full.d.ts +22 -0
  908. package/test/node_modules/ts-latest/lib/lib.es2024.object.d.ts +27 -0
  909. package/test/node_modules/ts-latest/lib/lib.es2024.promise.d.ts +33 -0
  910. package/test/node_modules/ts-latest/lib/lib.es2024.regexp.d.ts +23 -0
  911. package/test/node_modules/ts-latest/lib/lib.es2024.sharedmemory.d.ts +66 -0
  912. package/test/node_modules/ts-latest/lib/lib.es2024.string.d.ts +27 -0
  913. package/test/node_modules/ts-latest/lib/lib.es2025.collection.d.ts +94 -0
  914. package/test/node_modules/ts-latest/lib/lib.es2025.d.ts +23 -0
  915. package/test/node_modules/ts-latest/lib/lib.es2025.float16.d.ts +443 -0
  916. package/test/node_modules/ts-latest/lib/lib.es2025.full.d.ts +22 -0
  917. package/test/node_modules/ts-latest/lib/lib.es2025.intl.d.ts +200 -0
  918. package/test/node_modules/ts-latest/lib/lib.es2025.iterator.d.ts +146 -0
  919. package/test/node_modules/ts-latest/lib/lib.es2025.promise.d.ts +32 -0
  920. package/test/node_modules/ts-latest/lib/lib.es2025.regexp.d.ts +30 -0
  921. package/test/node_modules/ts-latest/lib/lib.es5.d.ts +4599 -0
  922. package/test/node_modules/ts-latest/lib/lib.es6.d.ts +21 -0
  923. package/test/node_modules/ts-latest/lib/lib.esnext.array.d.ts +33 -0
  924. package/test/node_modules/ts-latest/lib/lib.esnext.collection.d.ts +47 -0
  925. package/test/node_modules/ts-latest/lib/lib.esnext.d.ts +27 -0
  926. package/test/node_modules/ts-latest/lib/lib.esnext.date.d.ts +21 -0
  927. package/test/node_modules/ts-latest/lib/lib.esnext.decorators.d.ts +26 -0
  928. package/test/node_modules/ts-latest/lib/lib.esnext.disposable.d.ts +191 -0
  929. package/test/node_modules/ts-latest/lib/lib.esnext.error.d.ts +22 -0
  930. package/test/node_modules/ts-latest/lib/lib.esnext.full.d.ts +22 -0
  931. package/test/node_modules/ts-latest/lib/lib.esnext.intl.d.ts +107 -0
  932. package/test/node_modules/ts-latest/lib/lib.esnext.sharedmemory.d.ts +23 -0
  933. package/test/node_modules/ts-latest/lib/lib.esnext.temporal.d.ts +473 -0
  934. package/test/node_modules/ts-latest/lib/lib.esnext.typedarrays.d.ts +90 -0
  935. package/test/node_modules/ts-latest/lib/lib.scripthost.d.ts +320 -0
  936. package/test/node_modules/ts-latest/lib/lib.webworker.asynciterable.d.ts +18 -0
  937. package/test/node_modules/ts-latest/lib/lib.webworker.d.ts +14814 -0
  938. package/test/node_modules/ts-latest/lib/lib.webworker.importscripts.d.ts +21 -0
  939. package/test/node_modules/ts-latest/lib/lib.webworker.iterable.d.ts +18 -0
  940. package/test/node_modules/ts-latest/lib/pl/diagnosticMessages.generated.json +2129 -0
  941. package/test/node_modules/ts-latest/lib/pt-br/diagnosticMessages.generated.json +2129 -0
  942. package/test/node_modules/ts-latest/lib/ru/diagnosticMessages.generated.json +2125 -0
  943. package/test/node_modules/ts-latest/lib/tr/diagnosticMessages.generated.json +2129 -0
  944. package/test/node_modules/ts-latest/lib/tsc.js +8 -0
  945. package/test/node_modules/ts-latest/lib/tsserver.js +8 -0
  946. package/test/node_modules/ts-latest/lib/tsserverlibrary.d.ts +17 -0
  947. package/test/node_modules/ts-latest/lib/tsserverlibrary.js +21 -0
  948. package/test/node_modules/ts-latest/lib/typesMap.json +497 -0
  949. package/test/node_modules/ts-latest/lib/typescript.d.ts +11448 -0
  950. package/test/node_modules/ts-latest/lib/typescript.js +200997 -0
  951. package/test/node_modules/ts-latest/lib/typingsInstaller.js +8 -0
  952. package/test/node_modules/ts-latest/lib/watchGuard.js +53 -0
  953. package/test/node_modules/ts-latest/lib/zh-cn/diagnosticMessages.generated.json +2129 -0
  954. package/test/node_modules/ts-latest/lib/zh-tw/diagnosticMessages.generated.json +2125 -0
  955. package/test/node_modules/ts-latest/package.json +119 -0
  956. package/test/node_modules/ts-node/LICENSE +21 -0
  957. package/test/node_modules/ts-node/README.md +1442 -0
  958. package/test/node_modules/ts-node/child-loader.mjs +8 -0
  959. package/test/node_modules/ts-node/dist/bin-cwd.d.ts +2 -0
  960. package/test/node_modules/ts-node/dist/bin-cwd.js +6 -0
  961. package/test/node_modules/ts-node/dist/bin-cwd.js.map +1 -0
  962. package/test/node_modules/ts-node/dist/bin-esm.d.ts +2 -0
  963. package/test/node_modules/ts-node/dist/bin-esm.js +6 -0
  964. package/test/node_modules/ts-node/dist/bin-esm.js.map +1 -0
  965. package/test/node_modules/ts-node/dist/bin-script-deprecated.d.ts +2 -0
  966. package/test/node_modules/ts-node/dist/bin-script-deprecated.js +7 -0
  967. package/test/node_modules/ts-node/dist/bin-script-deprecated.js.map +1 -0
  968. package/test/node_modules/ts-node/dist/bin-script.d.ts +2 -0
  969. package/test/node_modules/ts-node/dist/bin-script.js +6 -0
  970. package/test/node_modules/ts-node/dist/bin-script.js.map +1 -0
  971. package/test/node_modules/ts-node/dist/bin-transpile.d.ts +2 -0
  972. package/test/node_modules/ts-node/dist/bin-transpile.js +6 -0
  973. package/test/node_modules/ts-node/dist/bin-transpile.js.map +1 -0
  974. package/test/node_modules/ts-node/dist/bin.d.ts +11 -0
  975. package/test/node_modules/ts-node/dist/bin.js +581 -0
  976. package/test/node_modules/ts-node/dist/bin.js.map +1 -0
  977. package/test/node_modules/ts-node/dist/child/argv-payload.d.ts +1 -0
  978. package/test/node_modules/ts-node/dist/child/argv-payload.js +19 -0
  979. package/test/node_modules/ts-node/dist/child/argv-payload.js.map +1 -0
  980. package/test/node_modules/ts-node/dist/child/child-entrypoint.d.ts +1 -0
  981. package/test/node_modules/ts-node/dist/child/child-entrypoint.js +24 -0
  982. package/test/node_modules/ts-node/dist/child/child-entrypoint.js.map +1 -0
  983. package/test/node_modules/ts-node/dist/child/child-loader.d.ts +1 -0
  984. package/test/node_modules/ts-node/dist/child/child-loader.js +32 -0
  985. package/test/node_modules/ts-node/dist/child/child-loader.js.map +1 -0
  986. package/test/node_modules/ts-node/dist/child/child-require.d.ts +7 -0
  987. package/test/node_modules/ts-node/dist/child/child-require.js +22 -0
  988. package/test/node_modules/ts-node/dist/child/child-require.js.map +1 -0
  989. package/test/node_modules/ts-node/dist/child/spawn-child.d.ts +1 -0
  990. package/test/node_modules/ts-node/dist/child/spawn-child.js +49 -0
  991. package/test/node_modules/ts-node/dist/child/spawn-child.js.map +1 -0
  992. package/test/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts +1 -0
  993. package/test/node_modules/ts-node/dist/cjs-resolve-hooks.js +29 -0
  994. package/test/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +1 -0
  995. package/test/node_modules/ts-node/dist/configuration.d.ts +1 -0
  996. package/test/node_modules/ts-node/dist/configuration.js +308 -0
  997. package/test/node_modules/ts-node/dist/configuration.js.map +1 -0
  998. package/test/node_modules/ts-node/dist/esm.d.ts +53 -0
  999. package/test/node_modules/ts-node/dist/esm.js +228 -0
  1000. package/test/node_modules/ts-node/dist/esm.js.map +1 -0
  1001. package/test/node_modules/ts-node/dist/file-extensions.d.ts +1 -0
  1002. package/test/node_modules/ts-node/dist/file-extensions.js +133 -0
  1003. package/test/node_modules/ts-node/dist/file-extensions.js.map +1 -0
  1004. package/test/node_modules/ts-node/dist/index.d.ts +332 -0
  1005. package/test/node_modules/ts-node/dist/index.js +953 -0
  1006. package/test/node_modules/ts-node/dist/index.js.map +1 -0
  1007. package/test/node_modules/ts-node/dist/module-type-classifier.d.ts +1 -0
  1008. package/test/node_modules/ts-node/dist/module-type-classifier.js +64 -0
  1009. package/test/node_modules/ts-node/dist/module-type-classifier.js.map +1 -0
  1010. package/test/node_modules/ts-node/dist/node-module-type-classifier.d.ts +1 -0
  1011. package/test/node_modules/ts-node/dist/node-module-type-classifier.js +39 -0
  1012. package/test/node_modules/ts-node/dist/node-module-type-classifier.js.map +1 -0
  1013. package/test/node_modules/ts-node/dist/repl.d.ts +78 -0
  1014. package/test/node_modules/ts-node/dist/repl.js +561 -0
  1015. package/test/node_modules/ts-node/dist/repl.js.map +1 -0
  1016. package/test/node_modules/ts-node/dist/resolver-functions.d.ts +1 -0
  1017. package/test/node_modules/ts-node/dist/resolver-functions.js +143 -0
  1018. package/test/node_modules/ts-node/dist/resolver-functions.js.map +1 -0
  1019. package/test/node_modules/ts-node/dist/transpilers/swc.d.ts +11 -0
  1020. package/test/node_modules/ts-node/dist/transpilers/swc.js +218 -0
  1021. package/test/node_modules/ts-node/dist/transpilers/swc.js.map +1 -0
  1022. package/test/node_modules/ts-node/dist/transpilers/types.d.ts +35 -0
  1023. package/test/node_modules/ts-node/dist/transpilers/types.js +3 -0
  1024. package/test/node_modules/ts-node/dist/transpilers/types.js.map +1 -0
  1025. package/test/node_modules/ts-node/dist/ts-compiler-types.d.ts +63 -0
  1026. package/test/node_modules/ts-node/dist/ts-compiler-types.js +3 -0
  1027. package/test/node_modules/ts-node/dist/ts-compiler-types.js.map +1 -0
  1028. package/test/node_modules/ts-node/dist/ts-internals.d.ts +6 -0
  1029. package/test/node_modules/ts-node/dist/ts-internals.js +321 -0
  1030. package/test/node_modules/ts-node/dist/ts-internals.js.map +1 -0
  1031. package/test/node_modules/ts-node/dist/ts-transpile-module.d.ts +1 -0
  1032. package/test/node_modules/ts-node/dist/ts-transpile-module.js +100 -0
  1033. package/test/node_modules/ts-node/dist/ts-transpile-module.js.map +1 -0
  1034. package/test/node_modules/ts-node/dist/tsconfig-schema.d.ts +13 -0
  1035. package/test/node_modules/ts-node/dist/tsconfig-schema.js +3 -0
  1036. package/test/node_modules/ts-node/dist/tsconfig-schema.js.map +1 -0
  1037. package/test/node_modules/ts-node/dist/tsconfigs.d.ts +1 -0
  1038. package/test/node_modules/ts-node/dist/tsconfigs.js +36 -0
  1039. package/test/node_modules/ts-node/dist/tsconfigs.js.map +1 -0
  1040. package/test/node_modules/ts-node/dist/util.d.ts +4 -0
  1041. package/test/node_modules/ts-node/dist/util.js +175 -0
  1042. package/test/node_modules/ts-node/dist/util.js.map +1 -0
  1043. package/test/node_modules/ts-node/dist-raw/NODE-LICENSE.md +24 -0
  1044. package/test/node_modules/ts-node/dist-raw/README.md +36 -0
  1045. package/test/node_modules/ts-node/dist-raw/node-internal-constants.js +4 -0
  1046. package/test/node_modules/ts-node/dist-raw/node-internal-errors.js +82 -0
  1047. package/test/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +89 -0
  1048. package/test/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +593 -0
  1049. package/test/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +106 -0
  1050. package/test/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +962 -0
  1051. package/test/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +44 -0
  1052. package/test/node_modules/ts-node/dist-raw/node-internal-repl-await.js +254 -0
  1053. package/test/node_modules/ts-node/dist-raw/node-internalBinding-fs.js +58 -0
  1054. package/test/node_modules/ts-node/dist-raw/node-nativemodule.js +9 -0
  1055. package/test/node_modules/ts-node/dist-raw/node-options.js +103 -0
  1056. package/test/node_modules/ts-node/dist-raw/node-primordials.js +37 -0
  1057. package/test/node_modules/ts-node/dist-raw/runmain-hack.js +9 -0
  1058. package/test/node_modules/ts-node/esm/transpile-only.mjs +8 -0
  1059. package/test/node_modules/ts-node/esm.mjs +8 -0
  1060. package/test/node_modules/ts-node/node10/tsconfig.json +3 -0
  1061. package/test/node_modules/ts-node/node12/tsconfig.json +3 -0
  1062. package/test/node_modules/ts-node/node14/tsconfig.json +3 -0
  1063. package/test/node_modules/ts-node/node16/tsconfig.json +3 -0
  1064. package/test/node_modules/ts-node/node_modules/.bin/acorn +15 -0
  1065. package/test/node_modules/ts-node/node_modules/.bin/acorn.cmd +7 -0
  1066. package/test/node_modules/ts-node/package.json +182 -0
  1067. package/test/node_modules/ts-node/register/files.js +3 -0
  1068. package/test/node_modules/ts-node/register/index.js +1 -0
  1069. package/test/node_modules/ts-node/register/transpile-only.js +3 -0
  1070. package/test/node_modules/ts-node/register/type-check.js +3 -0
  1071. package/test/node_modules/ts-node/transpilers/swc-experimental.js +1 -0
  1072. package/test/node_modules/ts-node/transpilers/swc.js +1 -0
  1073. package/test/node_modules/ts-node/tsconfig.schema.json +183 -0
  1074. package/test/node_modules/ts-node/tsconfig.schemastore-schema.json +1326 -0
  1075. package/test/node_modules/tsconfig-paths/CHANGELOG.md +407 -0
  1076. package/test/node_modules/tsconfig-paths/LICENSE +21 -0
  1077. package/test/node_modules/tsconfig-paths/README.md +269 -0
  1078. package/test/node_modules/tsconfig-paths/lib/__tests__/config-loader.test.d.ts +1 -0
  1079. package/test/node_modules/tsconfig-paths/lib/__tests__/config-loader.test.js +87 -0
  1080. package/test/node_modules/tsconfig-paths/lib/__tests__/config-loader.test.js.map +1 -0
  1081. package/test/node_modules/tsconfig-paths/lib/__tests__/data/match-path-data.d.ts +17 -0
  1082. package/test/node_modules/tsconfig-paths/lib/__tests__/data/match-path-data.js +216 -0
  1083. package/test/node_modules/tsconfig-paths/lib/__tests__/data/match-path-data.js.map +1 -0
  1084. package/test/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.d.ts +1 -0
  1085. package/test/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.js +56 -0
  1086. package/test/node_modules/tsconfig-paths/lib/__tests__/filesystem.test.js.map +1 -0
  1087. package/test/node_modules/tsconfig-paths/lib/__tests__/mapping-entry.test.d.ts +1 -0
  1088. package/test/node_modules/tsconfig-paths/lib/__tests__/mapping-entry.test.js +39 -0
  1089. package/test/node_modules/tsconfig-paths/lib/__tests__/mapping-entry.test.js.map +1 -0
  1090. package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-async.test.d.ts +1 -0
  1091. package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-async.test.js +18 -0
  1092. package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-async.test.js.map +1 -0
  1093. package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-sync.test.d.ts +1 -0
  1094. package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-sync.test.js +14 -0
  1095. package/test/node_modules/tsconfig-paths/lib/__tests__/match-path-sync.test.js.map +1 -0
  1096. package/test/node_modules/tsconfig-paths/lib/__tests__/try-path.test.d.ts +1 -0
  1097. package/test/node_modules/tsconfig-paths/lib/__tests__/try-path.test.js +124 -0
  1098. package/test/node_modules/tsconfig-paths/lib/__tests__/try-path.test.js.map +1 -0
  1099. package/test/node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.d.ts +1 -0
  1100. package/test/node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js +328 -0
  1101. package/test/node_modules/tsconfig-paths/lib/__tests__/tsconfig-loader.test.js.map +1 -0
  1102. package/test/node_modules/tsconfig-paths/lib/config-loader.d.ts +33 -0
  1103. package/test/node_modules/tsconfig-paths/lib/config-loader.js +48 -0
  1104. package/test/node_modules/tsconfig-paths/lib/config-loader.js.map +1 -0
  1105. package/test/node_modules/tsconfig-paths/lib/filesystem.d.ts +34 -0
  1106. package/test/node_modules/tsconfig-paths/lib/filesystem.js +61 -0
  1107. package/test/node_modules/tsconfig-paths/lib/filesystem.js.map +1 -0
  1108. package/test/node_modules/tsconfig-paths/lib/index.d.ts +5 -0
  1109. package/test/node_modules/tsconfig-paths/lib/index.js +15 -0
  1110. package/test/node_modules/tsconfig-paths/lib/index.js.map +1 -0
  1111. package/test/node_modules/tsconfig-paths/lib/mapping-entry.d.ts +18 -0
  1112. package/test/node_modules/tsconfig-paths/lib/mapping-entry.js +54 -0
  1113. package/test/node_modules/tsconfig-paths/lib/mapping-entry.js.map +1 -0
  1114. package/test/node_modules/tsconfig-paths/lib/match-path-async.d.ts +21 -0
  1115. package/test/node_modules/tsconfig-paths/lib/match-path-async.js +116 -0
  1116. package/test/node_modules/tsconfig-paths/lib/match-path-async.js.map +1 -0
  1117. package/test/node_modules/tsconfig-paths/lib/match-path-sync.d.ts +32 -0
  1118. package/test/node_modules/tsconfig-paths/lib/match-path-sync.js +91 -0
  1119. package/test/node_modules/tsconfig-paths/lib/match-path-sync.js.map +1 -0
  1120. package/test/node_modules/tsconfig-paths/lib/register.d.ts +12 -0
  1121. package/test/node_modules/tsconfig-paths/lib/register.js +112 -0
  1122. package/test/node_modules/tsconfig-paths/lib/register.js.map +1 -0
  1123. package/test/node_modules/tsconfig-paths/lib/try-path.d.ts +15 -0
  1124. package/test/node_modules/tsconfig-paths/lib/try-path.js +91 -0
  1125. package/test/node_modules/tsconfig-paths/lib/try-path.js.map +1 -0
  1126. package/test/node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts +28 -0
  1127. package/test/node_modules/tsconfig-paths/lib/tsconfig-loader.js +148 -0
  1128. package/test/node_modules/tsconfig-paths/lib/tsconfig-loader.js.map +1 -0
  1129. package/test/node_modules/tsconfig-paths/node_modules/.bin/json5 +15 -0
  1130. package/test/node_modules/tsconfig-paths/node_modules/.bin/json5.cmd +7 -0
  1131. package/test/node_modules/tsconfig-paths/package.json +74 -0
  1132. package/test/node_modules/tsconfig-paths/register.js +1 -0
  1133. package/test/node_modules/tsconfig-paths/src/__tests__/config-loader.test.ts +101 -0
  1134. package/test/node_modules/tsconfig-paths/src/__tests__/data/match-path-data.ts +230 -0
  1135. package/test/node_modules/tsconfig-paths/src/__tests__/filesystem.test.ts +57 -0
  1136. package/test/node_modules/tsconfig-paths/src/__tests__/mapping-entry.test.ts +43 -0
  1137. package/test/node_modules/tsconfig-paths/src/__tests__/match-path-async.test.ts +26 -0
  1138. package/test/node_modules/tsconfig-paths/src/__tests__/match-path-sync.test.ts +22 -0
  1139. package/test/node_modules/tsconfig-paths/src/__tests__/try-path.test.ts +141 -0
  1140. package/test/node_modules/tsconfig-paths/src/__tests__/tsconfig-loader.test.ts +428 -0
  1141. package/test/node_modules/tsconfig-paths/src/__tests__/tsconfig-named.json +10 -0
  1142. package/test/node_modules/tsconfig-paths/src/config-loader.ts +89 -0
  1143. package/test/node_modules/tsconfig-paths/src/filesystem.ts +93 -0
  1144. package/test/node_modules/tsconfig-paths/src/index.ts +24 -0
  1145. package/test/node_modules/tsconfig-paths/src/mapping-entry.ts +65 -0
  1146. package/test/node_modules/tsconfig-paths/src/match-path-async.ts +223 -0
  1147. package/test/node_modules/tsconfig-paths/src/match-path-sync.ts +146 -0
  1148. package/test/node_modules/tsconfig-paths/src/register.ts +123 -0
  1149. package/test/node_modules/tsconfig-paths/src/try-path.ts +103 -0
  1150. package/test/node_modules/tsconfig-paths/src/tsconfig-loader.ts +229 -0
  1151. package/test/node_modules/undici-types/LICENSE +21 -0
  1152. package/test/node_modules/undici-types/README.md +6 -0
  1153. package/test/node_modules/undici-types/agent.d.ts +32 -0
  1154. package/test/node_modules/undici-types/api.d.ts +43 -0
  1155. package/test/node_modules/undici-types/balanced-pool.d.ts +30 -0
  1156. package/test/node_modules/undici-types/cache-interceptor.d.ts +173 -0
  1157. package/test/node_modules/undici-types/cache.d.ts +36 -0
  1158. package/test/node_modules/undici-types/client-stats.d.ts +15 -0
  1159. package/test/node_modules/undici-types/client.d.ts +108 -0
  1160. package/test/node_modules/undici-types/connector.d.ts +34 -0
  1161. package/test/node_modules/undici-types/content-type.d.ts +21 -0
  1162. package/test/node_modules/undici-types/cookies.d.ts +30 -0
  1163. package/test/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  1164. package/test/node_modules/undici-types/dispatcher.d.ts +276 -0
  1165. package/test/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  1166. package/test/node_modules/undici-types/errors.d.ts +161 -0
  1167. package/test/node_modules/undici-types/eventsource.d.ts +66 -0
  1168. package/test/node_modules/undici-types/fetch.d.ts +211 -0
  1169. package/test/node_modules/undici-types/formdata.d.ts +108 -0
  1170. package/test/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  1171. package/test/node_modules/undici-types/global-origin.d.ts +7 -0
  1172. package/test/node_modules/undici-types/h2c-client.d.ts +73 -0
  1173. package/test/node_modules/undici-types/handlers.d.ts +15 -0
  1174. package/test/node_modules/undici-types/header.d.ts +160 -0
  1175. package/test/node_modules/undici-types/index.d.ts +88 -0
  1176. package/test/node_modules/undici-types/interceptors.d.ts +73 -0
  1177. package/test/node_modules/undici-types/mock-agent.d.ts +68 -0
  1178. package/test/node_modules/undici-types/mock-call-history.d.ts +111 -0
  1179. package/test/node_modules/undici-types/mock-client.d.ts +27 -0
  1180. package/test/node_modules/undici-types/mock-errors.d.ts +12 -0
  1181. package/test/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  1182. package/test/node_modules/undici-types/mock-pool.d.ts +27 -0
  1183. package/test/node_modules/undici-types/package.json +55 -0
  1184. package/test/node_modules/undici-types/patch.d.ts +29 -0
  1185. package/test/node_modules/undici-types/pool-stats.d.ts +19 -0
  1186. package/test/node_modules/undici-types/pool.d.ts +41 -0
  1187. package/test/node_modules/undici-types/proxy-agent.d.ts +29 -0
  1188. package/test/node_modules/undici-types/readable.d.ts +68 -0
  1189. package/test/node_modules/undici-types/retry-agent.d.ts +8 -0
  1190. package/test/node_modules/undici-types/retry-handler.d.ts +125 -0
  1191. package/test/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  1192. package/test/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  1193. package/test/node_modules/undici-types/util.d.ts +18 -0
  1194. package/test/node_modules/undici-types/utility.d.ts +7 -0
  1195. package/test/node_modules/undici-types/webidl.d.ts +341 -0
  1196. package/test/node_modules/undici-types/websocket.d.ts +186 -0
  1197. package/test/node_modules/universalify/LICENSE +20 -0
  1198. package/test/node_modules/universalify/README.md +76 -0
  1199. package/test/node_modules/universalify/index.js +24 -0
  1200. package/test/node_modules/universalify/package.json +34 -0
  1201. package/test/node_modules/v8-compile-cache-lib/CHANGELOG.md +53 -0
  1202. package/test/node_modules/v8-compile-cache-lib/LICENSE +21 -0
  1203. package/test/node_modules/v8-compile-cache-lib/README.md +60 -0
  1204. package/test/node_modules/v8-compile-cache-lib/package.json +35 -0
  1205. package/test/node_modules/v8-compile-cache-lib/v8-compile-cache.d.ts +7 -0
  1206. package/test/node_modules/v8-compile-cache-lib/v8-compile-cache.js +391 -0
  1207. package/test/node_modules/which/LICENSE +15 -0
  1208. package/test/node_modules/which/README.md +51 -0
  1209. package/test/node_modules/which/bin/which.js +52 -0
  1210. package/test/node_modules/which/lib/index.js +111 -0
  1211. package/test/node_modules/which/package.json +57 -0
  1212. package/test/node_modules/yn/index.d.ts +65 -0
  1213. package/test/node_modules/yn/index.js +33 -0
  1214. package/test/node_modules/yn/lenient.js +105 -0
  1215. package/test/node_modules/yn/license +9 -0
  1216. package/test/node_modules/yn/package.json +42 -0
  1217. package/test/node_modules/yn/readme.md +83 -0
  1218. package/test/package.json +14 -0
  1219. package/test/src/cleanup.ts +10 -0
  1220. package/test/src/config.ts +35 -0
  1221. package/test/src/perf.ts +110 -0
  1222. package/test/src/prepare.ts +10 -0
  1223. package/test/src/project.ts +134 -0
  1224. package/test/src/utils/general.ts +8 -0
  1225. package/test/tests/actions.test.ts +274 -0
  1226. package/test/tests/package-config.test.ts +40 -0
  1227. package/test/tests/path-mapping.test.ts +47 -0
  1228. package/test/tests/transformer.test.ts +44 -0
  1229. package/test/tests/webpack.test.ts +71 -0
  1230. package/test/tsconfig.json +12 -0
  1231. package/tsconfig.base.json +21 -0
  1232. package/actions/check.js +0 -45
  1233. package/actions/check.js.map +0 -1
  1234. package/actions/patch.js +0 -82
  1235. package/actions/patch.js.map +0 -1
  1236. package/actions/unpatch.js +0 -82
  1237. package/actions/unpatch.js.map +0 -1
  1238. package/bin/ts-patch.js +0 -33
  1239. package/bin/ts-patch.js.map +0 -1
  1240. package/cli/cli.js +0 -96
  1241. package/cli/cli.js.map +0 -1
  1242. package/cli/commands.js +0 -49
  1243. package/cli/commands.js.map +0 -1
  1244. package/config.js +0 -50
  1245. package/config.js.map +0 -1
  1246. package/module/module-file.d.ts +0 -9
  1247. package/module/module-file.js +0 -97
  1248. package/module/module-file.js.map +0 -1
  1249. package/module/ts-module.d.ts +0 -35
  1250. package/module/ts-module.js +0 -100
  1251. package/module/ts-module.js.map +0 -1
  1252. package/patch/get-patched-source.js +0 -69
  1253. package/patch/get-patched-source.js.map +0 -1
  1254. package/patch/transformers/fix-ts-early-return.js +0 -51
  1255. package/patch/transformers/fix-ts-early-return.js.map +0 -1
  1256. package/resources/module-patch.js +0 -609
  1257. package/system/cache.js +0 -69
  1258. package/system/cache.js.map +0 -1
  1259. package/tsconfig.tsbuildinfo +0 -1
  1260. package/utils/file-utils.js +0 -98
  1261. package/utils/file-utils.js.map +0 -1
  1262. /package/{actions → dist/actions}/check.d.ts +0 -0
  1263. /package/{actions → dist/actions}/index.d.ts +0 -0
  1264. /package/{actions → dist/actions}/index.js +0 -0
  1265. /package/{actions → dist/actions}/index.js.map +0 -0
  1266. /package/{actions → dist/actions}/install.d.ts +0 -0
  1267. /package/{actions → dist/actions}/install.js +0 -0
  1268. /package/{actions → dist/actions}/install.js.map +0 -0
  1269. /package/{actions → dist/actions}/patch.d.ts +0 -0
  1270. /package/{actions → dist/actions}/uninstall.d.ts +0 -0
  1271. /package/{actions → dist/actions}/uninstall.js +0 -0
  1272. /package/{actions → dist/actions}/uninstall.js.map +0 -0
  1273. /package/{actions → dist/actions}/unpatch.d.ts +0 -0
  1274. /package/{bin → dist/bin}/ts-patch.d.ts +0 -0
  1275. /package/{bin → dist/bin}/tspc.d.ts +0 -0
  1276. /package/{bin → dist/bin}/tspc.js +0 -0
  1277. /package/{bin → dist/bin}/tspc.js.map +0 -0
  1278. /package/{cli → dist/cli}/cli.d.ts +0 -0
  1279. /package/{cli → dist/cli}/commands.d.ts +0 -0
  1280. /package/{cli → dist/cli}/help-menu.d.ts +0 -0
  1281. /package/{cli → dist/cli}/help-menu.js +0 -0
  1282. /package/{cli → dist/cli}/help-menu.js.map +0 -0
  1283. /package/{cli → dist/cli}/options.d.ts +0 -0
  1284. /package/{cli → dist/cli}/options.js +0 -0
  1285. /package/{cli → dist/cli}/options.js.map +0 -0
  1286. /package/{compiler → dist/compiler}/package.json +0 -0
  1287. /package/{compiler → dist/compiler}/tsc.js +0 -0
  1288. /package/{compiler → dist/compiler}/tsserver.js +0 -0
  1289. /package/{compiler → dist/compiler}/tsserverlibrary.js +0 -0
  1290. /package/{compiler → dist/compiler}/typescript.js +0 -0
  1291. /package/{config.d.ts → dist/config.d.ts} +0 -0
  1292. /package/{index.d.ts → dist/index.d.ts} +0 -0
  1293. /package/{index.js → dist/index.js} +0 -0
  1294. /package/{index.js.map → dist/index.js.map} +0 -0
  1295. /package/{module → dist/module}/get-live-module.d.ts +0 -0
  1296. /package/{module → dist/module}/get-live-module.js +0 -0
  1297. /package/{module → dist/module}/get-live-module.js.map +0 -0
  1298. /package/{module → dist/module}/index.d.ts +0 -0
  1299. /package/{module → dist/module}/index.js +0 -0
  1300. /package/{module → dist/module}/index.js.map +0 -0
  1301. /package/{module → dist/module}/module-source.d.ts +0 -0
  1302. /package/{module → dist/module}/module-source.js +0 -0
  1303. /package/{module → dist/module}/module-source.js.map +0 -0
  1304. /package/{module → dist/module}/source-section.d.ts +0 -0
  1305. /package/{module → dist/module}/source-section.js +0 -0
  1306. /package/{module → dist/module}/source-section.js.map +0 -0
  1307. /package/{options.d.ts → dist/options.d.ts} +0 -0
  1308. /package/{options.js → dist/options.js} +0 -0
  1309. /package/{options.js.map → dist/options.js.map} +0 -0
  1310. /package/{patch → dist/patch}/get-patched-source.d.ts +0 -0
  1311. /package/{patch → dist/patch}/patch-detail.d.ts +0 -0
  1312. /package/{patch → dist/patch}/patch-detail.js +0 -0
  1313. /package/{patch → dist/patch}/patch-detail.js.map +0 -0
  1314. /package/{patch → dist/patch}/patch-module.d.ts +0 -0
  1315. /package/{patch → dist/patch}/patch-module.js +0 -0
  1316. /package/{patch → dist/patch}/patch-module.js.map +0 -0
  1317. /package/{patch → dist/patch}/transformers/add-original-create-program.d.ts +0 -0
  1318. /package/{patch → dist/patch}/transformers/add-original-create-program.js +0 -0
  1319. /package/{patch → dist/patch}/transformers/add-original-create-program.js.map +0 -0
  1320. /package/{patch → dist/patch}/transformers/fix-ts-early-return.d.ts +0 -0
  1321. /package/{patch → dist/patch}/transformers/hook-tsc-exec.d.ts +0 -0
  1322. /package/{patch → dist/patch}/transformers/hook-tsc-exec.js +0 -0
  1323. /package/{patch → dist/patch}/transformers/hook-tsc-exec.js.map +0 -0
  1324. /package/{patch → dist/patch}/transformers/index.d.ts +0 -0
  1325. /package/{patch → dist/patch}/transformers/index.js +0 -0
  1326. /package/{patch → dist/patch}/transformers/index.js.map +0 -0
  1327. /package/{patch → dist/patch}/transformers/merge-statements.d.ts +0 -0
  1328. /package/{patch → dist/patch}/transformers/merge-statements.js +0 -0
  1329. /package/{patch → dist/patch}/transformers/merge-statements.js.map +0 -0
  1330. /package/{patch → dist/patch}/transformers/patch-create-program.d.ts +0 -0
  1331. /package/{patch → dist/patch}/transformers/patch-create-program.js +0 -0
  1332. /package/{patch → dist/patch}/transformers/patch-create-program.js.map +0 -0
  1333. /package/{patch → dist/patch}/transformers/patch-emitter.d.ts +0 -0
  1334. /package/{patch → dist/patch}/transformers/patch-emitter.js +0 -0
  1335. /package/{patch → dist/patch}/transformers/patch-emitter.js.map +0 -0
  1336. /package/{plugin-types.d.ts → dist/plugin-types.d.ts} +0 -0
  1337. /package/{plugin-types.js → dist/plugin-types.js} +0 -0
  1338. /package/{plugin-types.js.map → dist/plugin-types.js.map} +0 -0
  1339. /package/{resources → dist/resources}/module-patch.d.ts +0 -0
  1340. /package/{slice → dist/slice}/module-slice.d.ts +0 -0
  1341. /package/{slice → dist/slice}/module-slice.js +0 -0
  1342. /package/{slice → dist/slice}/module-slice.js.map +0 -0
  1343. /package/{slice → dist/slice}/ts54.d.ts +0 -0
  1344. /package/{slice → dist/slice}/ts54.js +0 -0
  1345. /package/{slice → dist/slice}/ts54.js.map +0 -0
  1346. /package/{slice → dist/slice}/ts55.d.ts +0 -0
  1347. /package/{slice → dist/slice}/ts55.js +0 -0
  1348. /package/{slice → dist/slice}/ts55.js.map +0 -0
  1349. /package/{slice → dist/slice}/ts552.d.ts +0 -0
  1350. /package/{slice → dist/slice}/ts552.js +0 -0
  1351. /package/{slice → dist/slice}/ts552.js.map +0 -0
  1352. /package/{system → dist/system}/cache.d.ts +0 -0
  1353. /package/{system → dist/system}/errors.d.ts +0 -0
  1354. /package/{system → dist/system}/errors.js +0 -0
  1355. /package/{system → dist/system}/errors.js.map +0 -0
  1356. /package/{system → dist/system}/index.d.ts +0 -0
  1357. /package/{system → dist/system}/index.js +0 -0
  1358. /package/{system → dist/system}/index.js.map +0 -0
  1359. /package/{system → dist/system}/logger.d.ts +0 -0
  1360. /package/{system → dist/system}/logger.js +0 -0
  1361. /package/{system → dist/system}/logger.js.map +0 -0
  1362. /package/{system → dist/system}/types.d.ts +0 -0
  1363. /package/{system → dist/system}/types.js +0 -0
  1364. /package/{system → dist/system}/types.js.map +0 -0
  1365. /package/{ts-package.d.ts → dist/ts-package.d.ts} +0 -0
  1366. /package/{ts-package.js → dist/ts-package.js} +0 -0
  1367. /package/{ts-package.js.map → dist/ts-package.js.map} +0 -0
  1368. /package/{utils → dist/utils}/file-utils.d.ts +0 -0
  1369. /package/{utils → dist/utils}/find-cache-dir.d.ts +0 -0
  1370. /package/{utils → dist/utils}/find-cache-dir.js +0 -0
  1371. /package/{utils → dist/utils}/find-cache-dir.js.map +0 -0
  1372. /package/{utils → dist/utils}/general.d.ts +0 -0
  1373. /package/{utils → dist/utils}/general.js +0 -0
  1374. /package/{utils → dist/utils}/general.js.map +0 -0
  1375. /package/{utils → dist/utils}/index.d.ts +0 -0
  1376. /package/{utils → dist/utils}/index.js +0 -0
  1377. /package/{utils → dist/utils}/index.js.map +0 -0
@@ -0,0 +1,2275 @@
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
+ }