css-variable-lsp 1.0.0 → 1.0.2

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