@goast/typescript 0.4.1 → 0.4.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 (621) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +52 -52
  3. package/assets/client/angular/angular-service.utils.ts +82 -82
  4. package/assets/client/angular/request-builder.ts +377 -377
  5. package/assets/client/fetch/fetch-client.utils.ts +52 -52
  6. package/assets/client/k6/request-builder.js +418 -418
  7. package/assets/stubs/easy-network-stub/easy-network-stub.utils.ts +259 -259
  8. package/esm/src/generators/models/model-generator.js +1 -1
  9. package/esm/src/generators/models/models.d.ts +5 -0
  10. package/esm/src/generators/models/models.d.ts.map +1 -1
  11. package/esm/src/generators/models/models.js +1 -0
  12. package/esm/src/generators/services/angular-services/angular-service-generator.d.ts.map +1 -1
  13. package/esm/src/generators/services/angular-services/angular-service-generator.js +12 -10
  14. package/esm/src/generators/services/easy-network-stub/easy-network-stub-generator.js +9 -9
  15. package/esm/src/generators/services/fetch-clients/fetch-client-generator.js +2 -2
  16. package/esm/src/generators/services/k6-clients/k6-client-generator.js +6 -6
  17. package/package.json +2 -2
  18. package/script/src/generators/models/model-generator.js +1 -1
  19. package/script/src/generators/models/models.d.ts +5 -0
  20. package/script/src/generators/models/models.d.ts.map +1 -1
  21. package/script/src/generators/models/models.js +1 -0
  22. package/script/src/generators/services/angular-services/angular-service-generator.d.ts.map +1 -1
  23. package/script/src/generators/services/angular-services/angular-service-generator.js +12 -10
  24. package/script/src/generators/services/easy-network-stub/easy-network-stub-generator.js +9 -9
  25. package/script/src/generators/services/fetch-clients/fetch-client-generator.js +2 -2
  26. package/script/src/generators/services/k6-clients/k6-client-generator.js +6 -6
  27. package/esm/_dnt.test_polyfills.d.ts +0 -29
  28. package/esm/_dnt.test_polyfills.d.ts.map +0 -1
  29. package/esm/_dnt.test_polyfills.js +0 -31
  30. package/esm/_dnt.test_shims.d.ts +0 -6
  31. package/esm/_dnt.test_shims.d.ts.map +0 -1
  32. package/esm/_dnt.test_shims.js +0 -61
  33. package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +0 -26
  34. package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
  35. package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -30
  36. package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
  37. package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
  38. package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -136
  39. package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
  40. package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
  41. package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -45
  42. package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
  43. package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
  44. package/esm/deps/jsr.io/@std/assert/1.0.6/false.js +0 -22
  45. package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
  46. package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
  47. package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -53
  48. package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
  49. package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
  50. package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -54
  51. package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
  52. package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
  53. package/esm/deps/jsr.io/@std/assert/1.0.6/match.js +0 -26
  54. package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
  55. package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
  56. package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -29
  57. package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
  58. package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
  59. package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -26
  60. package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
  61. package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
  62. package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -32
  63. package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
  64. package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
  65. package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -159
  66. package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts +0 -42
  67. package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts.map +0 -1
  68. package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.js +0 -53
  69. package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
  70. package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
  71. package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -57
  72. package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts +0 -20
  73. package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.js +0 -29
  75. package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts +0 -17
  76. package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts.map +0 -1
  77. package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.js +0 -26
  78. package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts +0 -3
  79. package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts.map +0 -1
  80. package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.js +0 -9
  81. package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts +0 -41
  82. package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +0 -1
  83. package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.js +0 -143
  84. package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts +0 -6
  85. package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts.map +0 -1
  86. package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.js +0 -29
  87. package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts +0 -4
  88. package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts.map +0 -1
  89. package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.js +0 -11
  90. package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts +0 -9
  91. package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts.map +0 -1
  92. package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.js +0 -191
  93. package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts +0 -4
  94. package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts.map +0 -1
  95. package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.js +0 -11
  96. package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts +0 -3
  97. package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts.map +0 -1
  98. package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.js +0 -12
  99. package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts +0 -34
  100. package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts.map +0 -1
  101. package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.js +0 -564
  102. package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts +0 -11
  103. package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts.map +0 -1
  104. package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.js +0 -10
  105. package/esm/deps/jsr.io/@std/expect/1.0.6/_types.d.ts +0 -838
  106. package/esm/deps/jsr.io/@std/expect/1.0.6/_types.d.ts.map +0 -1
  107. package/esm/deps/jsr.io/@std/expect/1.0.6/_types.js +0 -3
  108. package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts +0 -8
  109. package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts.map +0 -1
  110. package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.js +0 -159
  111. package/esm/deps/jsr.io/@std/expect/1.0.6/expect.d.ts +0 -52
  112. package/esm/deps/jsr.io/@std/expect/1.0.6/expect.d.ts.map +0 -1
  113. package/esm/deps/jsr.io/@std/expect/1.0.6/expect.js +0 -441
  114. package/esm/deps/jsr.io/@std/expect/1.0.6/fn.d.ts +0 -29
  115. package/esm/deps/jsr.io/@std/expect/1.0.6/fn.d.ts.map +0 -1
  116. package/esm/deps/jsr.io/@std/expect/1.0.6/fn.js +0 -85
  117. package/esm/deps/jsr.io/@std/expect/1.0.6/mod.d.ts +0 -85
  118. package/esm/deps/jsr.io/@std/expect/1.0.6/mod.d.ts.map +0 -1
  119. package/esm/deps/jsr.io/@std/expect/1.0.6/mod.js +0 -87
  120. package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
  121. package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
  122. package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -101
  123. package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
  124. package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
  125. package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -111
  126. package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
  127. package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
  128. package/esm/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -277
  129. package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
  130. package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
  131. package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -180
  132. package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
  133. package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
  134. package/esm/deps/jsr.io/@std/internal/1.0.4/format.js +0 -37
  135. package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
  136. package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
  137. package/esm/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -207
  138. package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
  139. package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
  140. package/esm/deps/jsr.io/@std/internal/1.0.4/types.js +0 -2
  141. package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
  142. package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
  143. package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -340
  144. package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
  145. package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
  146. package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -576
  147. package/esm/deps/jsr.io/@std/testing/1.0.3/mock.d.ts +0 -674
  148. package/esm/deps/jsr.io/@std/testing/1.0.3/mock.d.ts.map +0 -1
  149. package/esm/deps/jsr.io/@std/testing/1.0.3/mock.js +0 -1117
  150. package/esm/src/ast/nodes/argument.test.d.ts +0 -2
  151. package/esm/src/ast/nodes/argument.test.d.ts.map +0 -1
  152. package/esm/src/ast/nodes/argument.test.js +0 -34
  153. package/esm/src/ast/nodes/array-type.test.d.ts +0 -2
  154. package/esm/src/ast/nodes/array-type.test.d.ts.map +0 -1
  155. package/esm/src/ast/nodes/array-type.test.js +0 -26
  156. package/esm/src/ast/nodes/arrow-function.test.d.ts +0 -2
  157. package/esm/src/ast/nodes/arrow-function.test.d.ts.map +0 -1
  158. package/esm/src/ast/nodes/arrow-function.test.js +0 -62
  159. package/esm/src/ast/nodes/class.test.d.ts +0 -2
  160. package/esm/src/ast/nodes/class.test.d.ts.map +0 -1
  161. package/esm/src/ast/nodes/class.test.js +0 -150
  162. package/esm/src/ast/nodes/constructor-parameter.test.d.ts +0 -2
  163. package/esm/src/ast/nodes/constructor-parameter.test.d.ts.map +0 -1
  164. package/esm/src/ast/nodes/constructor-parameter.test.js +0 -99
  165. package/esm/src/ast/nodes/constructor.test.d.ts +0 -2
  166. package/esm/src/ast/nodes/constructor.test.d.ts.map +0 -1
  167. package/esm/src/ast/nodes/constructor.test.js +0 -102
  168. package/esm/src/ast/nodes/decorator.test.d.ts +0 -2
  169. package/esm/src/ast/nodes/decorator.test.d.ts.map +0 -1
  170. package/esm/src/ast/nodes/decorator.test.js +0 -47
  171. package/esm/src/ast/nodes/doc-tag.test.d.ts +0 -2
  172. package/esm/src/ast/nodes/doc-tag.test.d.ts.map +0 -1
  173. package/esm/src/ast/nodes/doc-tag.test.js +0 -30
  174. package/esm/src/ast/nodes/doc.test.d.ts +0 -2
  175. package/esm/src/ast/nodes/doc.test.d.ts.map +0 -1
  176. package/esm/src/ast/nodes/doc.test.js +0 -31
  177. package/esm/src/ast/nodes/enum-value.test.d.ts +0 -2
  178. package/esm/src/ast/nodes/enum-value.test.d.ts.map +0 -1
  179. package/esm/src/ast/nodes/enum-value.test.js +0 -52
  180. package/esm/src/ast/nodes/enum.test.d.ts +0 -2
  181. package/esm/src/ast/nodes/enum.test.d.ts.map +0 -1
  182. package/esm/src/ast/nodes/enum.test.js +0 -66
  183. package/esm/src/ast/nodes/export.test.d.ts +0 -2
  184. package/esm/src/ast/nodes/export.test.d.ts.map +0 -1
  185. package/esm/src/ast/nodes/export.test.js +0 -22
  186. package/esm/src/ast/nodes/function-type.test.d.ts +0 -2
  187. package/esm/src/ast/nodes/function-type.test.d.ts.map +0 -1
  188. package/esm/src/ast/nodes/function-type.test.js +0 -48
  189. package/esm/src/ast/nodes/function.test.d.ts +0 -2
  190. package/esm/src/ast/nodes/function.test.d.ts.map +0 -1
  191. package/esm/src/ast/nodes/function.test.js +0 -108
  192. package/esm/src/ast/nodes/generic-parameter.test.d.ts +0 -2
  193. package/esm/src/ast/nodes/generic-parameter.test.d.ts.map +0 -1
  194. package/esm/src/ast/nodes/generic-parameter.test.js +0 -70
  195. package/esm/src/ast/nodes/indexer.test.d.ts +0 -2
  196. package/esm/src/ast/nodes/indexer.test.d.ts.map +0 -1
  197. package/esm/src/ast/nodes/indexer.test.js +0 -32
  198. package/esm/src/ast/nodes/interface.test.d.ts +0 -2
  199. package/esm/src/ast/nodes/interface.test.d.ts.map +0 -1
  200. package/esm/src/ast/nodes/interface.test.js +0 -115
  201. package/esm/src/ast/nodes/intersection-type.test.d.ts +0 -2
  202. package/esm/src/ast/nodes/intersection-type.test.d.ts.map +0 -1
  203. package/esm/src/ast/nodes/intersection-type.test.js +0 -38
  204. package/esm/src/ast/nodes/method.test.d.ts +0 -2
  205. package/esm/src/ast/nodes/method.test.d.ts.map +0 -1
  206. package/esm/src/ast/nodes/method.test.js +0 -148
  207. package/esm/src/ast/nodes/object-type.test.d.ts +0 -2
  208. package/esm/src/ast/nodes/object-type.test.d.ts.map +0 -1
  209. package/esm/src/ast/nodes/object-type.test.js +0 -30
  210. package/esm/src/ast/nodes/object.test.d.ts +0 -2
  211. package/esm/src/ast/nodes/object.test.d.ts.map +0 -1
  212. package/esm/src/ast/nodes/object.test.js +0 -30
  213. package/esm/src/ast/nodes/parameter.test.d.ts +0 -2
  214. package/esm/src/ast/nodes/parameter.test.d.ts.map +0 -1
  215. package/esm/src/ast/nodes/parameter.test.js +0 -71
  216. package/esm/src/ast/nodes/property-accessor.test.d.ts +0 -2
  217. package/esm/src/ast/nodes/property-accessor.test.d.ts.map +0 -1
  218. package/esm/src/ast/nodes/property-accessor.test.js +0 -102
  219. package/esm/src/ast/nodes/property.test.d.ts +0 -2
  220. package/esm/src/ast/nodes/property.test.d.ts.map +0 -1
  221. package/esm/src/ast/nodes/property.test.js +0 -89
  222. package/esm/src/ast/nodes/reference.test.d.ts +0 -2
  223. package/esm/src/ast/nodes/reference.test.d.ts.map +0 -1
  224. package/esm/src/ast/nodes/reference.test.js +0 -31
  225. package/esm/src/ast/nodes/string.test.d.ts +0 -2
  226. package/esm/src/ast/nodes/string.test.d.ts.map +0 -1
  227. package/esm/src/ast/nodes/string.test.js +0 -28
  228. package/esm/src/ast/nodes/tuple.test.d.ts +0 -2
  229. package/esm/src/ast/nodes/tuple.test.d.ts.map +0 -1
  230. package/esm/src/ast/nodes/tuple.test.js +0 -33
  231. package/esm/src/ast/nodes/type-alias.test.d.ts +0 -2
  232. package/esm/src/ast/nodes/type-alias.test.d.ts.map +0 -1
  233. package/esm/src/ast/nodes/type-alias.test.js +0 -27
  234. package/esm/src/ast/nodes/union-type.test.d.ts +0 -2
  235. package/esm/src/ast/nodes/union-type.test.d.ts.map +0 -1
  236. package/esm/src/ast/nodes/union-type.test.js +0 -38
  237. package/esm/src/ast/nodes/variable.test.d.ts +0 -2
  238. package/esm/src/ast/nodes/variable.test.d.ts.map +0 -1
  239. package/esm/src/ast/nodes/variable.test.js +0 -38
  240. package/esm/src/import-collection.test.d.ts +0 -2
  241. package/esm/src/import-collection.test.d.ts.map +0 -1
  242. package/esm/src/import-collection.test.js +0 -64
  243. package/esm/tests/openapi-models.test.d.ts +0 -2
  244. package/esm/tests/openapi-models.test.d.ts.map +0 -1
  245. package/esm/tests/openapi-models.test.js +0 -45
  246. package/script/_dnt.test_polyfills.d.ts +0 -29
  247. package/script/_dnt.test_polyfills.d.ts.map +0 -1
  248. package/script/_dnt.test_polyfills.js +0 -32
  249. package/script/_dnt.test_shims.d.ts +0 -6
  250. package/script/_dnt.test_shims.d.ts.map +0 -1
  251. package/script/_dnt.test_shims.js +0 -65
  252. package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +0 -26
  253. package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
  254. package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -34
  255. package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
  256. package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
  257. package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -139
  258. package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
  259. package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
  260. package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -48
  261. package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
  262. package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
  263. package/script/deps/jsr.io/@std/assert/1.0.6/false.js +0 -25
  264. package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
  265. package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
  266. package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -56
  267. package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
  268. package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
  269. package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -57
  270. package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
  271. package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
  272. package/script/deps/jsr.io/@std/assert/1.0.6/match.js +0 -29
  273. package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
  274. package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
  275. package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -32
  276. package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
  277. package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
  278. package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -29
  279. package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
  280. package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
  281. package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -35
  282. package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
  283. package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
  284. package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -162
  285. package/script/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts +0 -42
  286. package/script/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts.map +0 -1
  287. package/script/deps/jsr.io/@std/assert/1.0.6/rejects.js +0 -56
  288. package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
  289. package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
  290. package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -60
  291. package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts +0 -20
  292. package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts.map +0 -1
  293. package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.js +0 -32
  294. package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts +0 -17
  295. package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts.map +0 -1
  296. package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.js +0 -29
  297. package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts +0 -3
  298. package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts.map +0 -1
  299. package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.js +0 -13
  300. package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts +0 -41
  301. package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +0 -1
  302. package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.js +0 -161
  303. package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts +0 -6
  304. package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts.map +0 -1
  305. package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.js +0 -33
  306. package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts +0 -4
  307. package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts.map +0 -1
  308. package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.js +0 -15
  309. package/script/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts +0 -9
  310. package/script/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts.map +0 -1
  311. package/script/deps/jsr.io/@std/expect/1.0.6/_equal.js +0 -194
  312. package/script/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts +0 -4
  313. package/script/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts.map +0 -1
  314. package/script/deps/jsr.io/@std/expect/1.0.6/_extend.js +0 -15
  315. package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts +0 -3
  316. package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts.map +0 -1
  317. package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.js +0 -17
  318. package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts +0 -34
  319. package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts.map +0 -1
  320. package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.js +0 -598
  321. package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts +0 -11
  322. package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts.map +0 -1
  323. package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.js +0 -14
  324. package/script/deps/jsr.io/@std/expect/1.0.6/_types.d.ts +0 -838
  325. package/script/deps/jsr.io/@std/expect/1.0.6/_types.d.ts.map +0 -1
  326. package/script/deps/jsr.io/@std/expect/1.0.6/_types.js +0 -4
  327. package/script/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts +0 -8
  328. package/script/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts.map +0 -1
  329. package/script/deps/jsr.io/@std/expect/1.0.6/_utils.js +0 -166
  330. package/script/deps/jsr.io/@std/expect/1.0.6/expect.d.ts +0 -52
  331. package/script/deps/jsr.io/@std/expect/1.0.6/expect.d.ts.map +0 -1
  332. package/script/deps/jsr.io/@std/expect/1.0.6/expect.js +0 -445
  333. package/script/deps/jsr.io/@std/expect/1.0.6/fn.d.ts +0 -29
  334. package/script/deps/jsr.io/@std/expect/1.0.6/fn.d.ts.map +0 -1
  335. package/script/deps/jsr.io/@std/expect/1.0.6/fn.js +0 -88
  336. package/script/deps/jsr.io/@std/expect/1.0.6/mod.d.ts +0 -85
  337. package/script/deps/jsr.io/@std/expect/1.0.6/mod.d.ts.map +0 -1
  338. package/script/deps/jsr.io/@std/expect/1.0.6/mod.js +0 -90
  339. package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
  340. package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
  341. package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -106
  342. package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
  343. package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
  344. package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -116
  345. package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
  346. package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
  347. package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -284
  348. package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
  349. package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
  350. package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -186
  351. package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
  352. package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
  353. package/script/deps/jsr.io/@std/internal/1.0.4/format.js +0 -41
  354. package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
  355. package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
  356. package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -220
  357. package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
  358. package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
  359. package/script/deps/jsr.io/@std/internal/1.0.4/types.js +0 -3
  360. package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
  361. package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
  362. package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -345
  363. package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
  364. package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
  365. package/script/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -587
  366. package/script/deps/jsr.io/@std/testing/1.0.3/mock.d.ts +0 -674
  367. package/script/deps/jsr.io/@std/testing/1.0.3/mock.d.ts.map +0 -1
  368. package/script/deps/jsr.io/@std/testing/1.0.3/mock.js +0 -1136
  369. package/script/src/ast/nodes/argument.test.d.ts +0 -2
  370. package/script/src/ast/nodes/argument.test.d.ts.map +0 -1
  371. package/script/src/ast/nodes/argument.test.js +0 -36
  372. package/script/src/ast/nodes/array-type.test.d.ts +0 -2
  373. package/script/src/ast/nodes/array-type.test.d.ts.map +0 -1
  374. package/script/src/ast/nodes/array-type.test.js +0 -28
  375. package/script/src/ast/nodes/arrow-function.test.d.ts +0 -2
  376. package/script/src/ast/nodes/arrow-function.test.d.ts.map +0 -1
  377. package/script/src/ast/nodes/arrow-function.test.js +0 -64
  378. package/script/src/ast/nodes/class.test.d.ts +0 -2
  379. package/script/src/ast/nodes/class.test.d.ts.map +0 -1
  380. package/script/src/ast/nodes/class.test.js +0 -152
  381. package/script/src/ast/nodes/constructor-parameter.test.d.ts +0 -2
  382. package/script/src/ast/nodes/constructor-parameter.test.d.ts.map +0 -1
  383. package/script/src/ast/nodes/constructor-parameter.test.js +0 -101
  384. package/script/src/ast/nodes/constructor.test.d.ts +0 -2
  385. package/script/src/ast/nodes/constructor.test.d.ts.map +0 -1
  386. package/script/src/ast/nodes/constructor.test.js +0 -104
  387. package/script/src/ast/nodes/decorator.test.d.ts +0 -2
  388. package/script/src/ast/nodes/decorator.test.d.ts.map +0 -1
  389. package/script/src/ast/nodes/decorator.test.js +0 -49
  390. package/script/src/ast/nodes/doc-tag.test.d.ts +0 -2
  391. package/script/src/ast/nodes/doc-tag.test.d.ts.map +0 -1
  392. package/script/src/ast/nodes/doc-tag.test.js +0 -32
  393. package/script/src/ast/nodes/doc.test.d.ts +0 -2
  394. package/script/src/ast/nodes/doc.test.d.ts.map +0 -1
  395. package/script/src/ast/nodes/doc.test.js +0 -33
  396. package/script/src/ast/nodes/enum-value.test.d.ts +0 -2
  397. package/script/src/ast/nodes/enum-value.test.d.ts.map +0 -1
  398. package/script/src/ast/nodes/enum-value.test.js +0 -54
  399. package/script/src/ast/nodes/enum.test.d.ts +0 -2
  400. package/script/src/ast/nodes/enum.test.d.ts.map +0 -1
  401. package/script/src/ast/nodes/enum.test.js +0 -68
  402. package/script/src/ast/nodes/export.test.d.ts +0 -2
  403. package/script/src/ast/nodes/export.test.d.ts.map +0 -1
  404. package/script/src/ast/nodes/export.test.js +0 -24
  405. package/script/src/ast/nodes/function-type.test.d.ts +0 -2
  406. package/script/src/ast/nodes/function-type.test.d.ts.map +0 -1
  407. package/script/src/ast/nodes/function-type.test.js +0 -50
  408. package/script/src/ast/nodes/function.test.d.ts +0 -2
  409. package/script/src/ast/nodes/function.test.d.ts.map +0 -1
  410. package/script/src/ast/nodes/function.test.js +0 -110
  411. package/script/src/ast/nodes/generic-parameter.test.d.ts +0 -2
  412. package/script/src/ast/nodes/generic-parameter.test.d.ts.map +0 -1
  413. package/script/src/ast/nodes/generic-parameter.test.js +0 -72
  414. package/script/src/ast/nodes/indexer.test.d.ts +0 -2
  415. package/script/src/ast/nodes/indexer.test.d.ts.map +0 -1
  416. package/script/src/ast/nodes/indexer.test.js +0 -34
  417. package/script/src/ast/nodes/interface.test.d.ts +0 -2
  418. package/script/src/ast/nodes/interface.test.d.ts.map +0 -1
  419. package/script/src/ast/nodes/interface.test.js +0 -117
  420. package/script/src/ast/nodes/intersection-type.test.d.ts +0 -2
  421. package/script/src/ast/nodes/intersection-type.test.d.ts.map +0 -1
  422. package/script/src/ast/nodes/intersection-type.test.js +0 -40
  423. package/script/src/ast/nodes/method.test.d.ts +0 -2
  424. package/script/src/ast/nodes/method.test.d.ts.map +0 -1
  425. package/script/src/ast/nodes/method.test.js +0 -150
  426. package/script/src/ast/nodes/object-type.test.d.ts +0 -2
  427. package/script/src/ast/nodes/object-type.test.d.ts.map +0 -1
  428. package/script/src/ast/nodes/object-type.test.js +0 -32
  429. package/script/src/ast/nodes/object.test.d.ts +0 -2
  430. package/script/src/ast/nodes/object.test.d.ts.map +0 -1
  431. package/script/src/ast/nodes/object.test.js +0 -32
  432. package/script/src/ast/nodes/parameter.test.d.ts +0 -2
  433. package/script/src/ast/nodes/parameter.test.d.ts.map +0 -1
  434. package/script/src/ast/nodes/parameter.test.js +0 -73
  435. package/script/src/ast/nodes/property-accessor.test.d.ts +0 -2
  436. package/script/src/ast/nodes/property-accessor.test.d.ts.map +0 -1
  437. package/script/src/ast/nodes/property-accessor.test.js +0 -104
  438. package/script/src/ast/nodes/property.test.d.ts +0 -2
  439. package/script/src/ast/nodes/property.test.d.ts.map +0 -1
  440. package/script/src/ast/nodes/property.test.js +0 -91
  441. package/script/src/ast/nodes/reference.test.d.ts +0 -2
  442. package/script/src/ast/nodes/reference.test.d.ts.map +0 -1
  443. package/script/src/ast/nodes/reference.test.js +0 -33
  444. package/script/src/ast/nodes/string.test.d.ts +0 -2
  445. package/script/src/ast/nodes/string.test.d.ts.map +0 -1
  446. package/script/src/ast/nodes/string.test.js +0 -30
  447. package/script/src/ast/nodes/tuple.test.d.ts +0 -2
  448. package/script/src/ast/nodes/tuple.test.d.ts.map +0 -1
  449. package/script/src/ast/nodes/tuple.test.js +0 -35
  450. package/script/src/ast/nodes/type-alias.test.d.ts +0 -2
  451. package/script/src/ast/nodes/type-alias.test.d.ts.map +0 -1
  452. package/script/src/ast/nodes/type-alias.test.js +0 -29
  453. package/script/src/ast/nodes/union-type.test.d.ts +0 -2
  454. package/script/src/ast/nodes/union-type.test.d.ts.map +0 -1
  455. package/script/src/ast/nodes/union-type.test.js +0 -40
  456. package/script/src/ast/nodes/variable.test.d.ts +0 -2
  457. package/script/src/ast/nodes/variable.test.d.ts.map +0 -1
  458. package/script/src/ast/nodes/variable.test.js +0 -40
  459. package/script/src/import-collection.test.d.ts +0 -2
  460. package/script/src/import-collection.test.d.ts.map +0 -1
  461. package/script/src/import-collection.test.js +0 -66
  462. package/script/tests/openapi-models.test.d.ts +0 -2
  463. package/script/tests/openapi-models.test.d.ts.map +0 -1
  464. package/script/tests/openapi-models.test.js +0 -48
  465. package/src/_dnt.test_polyfills.ts +0 -70
  466. package/src/_dnt.test_shims.ts +0 -64
  467. package/src/deps/jsr.io/@std/assert/1.0.6/assertion_error.ts +0 -31
  468. package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +0 -152
  469. package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +0 -52
  470. package/src/deps/jsr.io/@std/assert/1.0.6/false.ts +0 -26
  471. package/src/deps/jsr.io/@std/assert/1.0.6/instance_of.ts +0 -64
  472. package/src/deps/jsr.io/@std/assert/1.0.6/is_error.ts +0 -65
  473. package/src/deps/jsr.io/@std/assert/1.0.6/match.ts +0 -30
  474. package/src/deps/jsr.io/@std/assert/1.0.6/not_instance_of.ts +0 -33
  475. package/src/deps/jsr.io/@std/assert/1.0.6/not_match.ts +0 -30
  476. package/src/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.ts +0 -42
  477. package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +0 -202
  478. package/src/deps/jsr.io/@std/assert/1.0.6/rejects.ts +0 -123
  479. package/src/deps/jsr.io/@std/assert/1.0.6/strict_equals.ts +0 -67
  480. package/src/deps/jsr.io/@std/expect/1.0.6/_assert_equals.ts +0 -38
  481. package/src/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.ts +0 -35
  482. package/src/deps/jsr.io/@std/expect/1.0.6/_assertion.ts +0 -13
  483. package/src/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.ts +0 -177
  484. package/src/deps/jsr.io/@std/expect/1.0.6/_build_message.ts +0 -51
  485. package/src/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.ts +0 -19
  486. package/src/deps/jsr.io/@std/expect/1.0.6/_equal.ts +0 -229
  487. package/src/deps/jsr.io/@std/expect/1.0.6/_extend.ts +0 -16
  488. package/src/deps/jsr.io/@std/expect/1.0.6/_inspect_args.ts +0 -15
  489. package/src/deps/jsr.io/@std/expect/1.0.6/_matchers.ts +0 -828
  490. package/src/deps/jsr.io/@std/expect/1.0.6/_mock_util.ts +0 -22
  491. package/src/deps/jsr.io/@std/expect/1.0.6/_types.ts +0 -917
  492. package/src/deps/jsr.io/@std/expect/1.0.6/_utils.ts +0 -201
  493. package/src/deps/jsr.io/@std/expect/1.0.6/expect.ts +0 -529
  494. package/src/deps/jsr.io/@std/expect/1.0.6/fn.ts +0 -91
  495. package/src/deps/jsr.io/@std/expect/1.0.6/mod.ts +0 -88
  496. package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +0 -111
  497. package/src/deps/jsr.io/@std/internal/1.0.4/build_message.ts +0 -134
  498. package/src/deps/jsr.io/@std/internal/1.0.4/diff.ts +0 -317
  499. package/src/deps/jsr.io/@std/internal/1.0.4/diff_str.ts +0 -204
  500. package/src/deps/jsr.io/@std/internal/1.0.4/format.ts +0 -39
  501. package/src/deps/jsr.io/@std/internal/1.0.4/styles.ts +0 -233
  502. package/src/deps/jsr.io/@std/internal/1.0.4/types.ts +0 -18
  503. package/src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts +0 -389
  504. package/src/deps/jsr.io/@std/testing/1.0.3/bdd.ts +0 -1202
  505. package/src/deps/jsr.io/@std/testing/1.0.3/mock.ts +0 -1839
  506. package/src/mod.ts +0 -7
  507. package/src/src/assets.ts +0 -9
  508. package/src/src/ast/_index.ts +0 -54
  509. package/src/src/ast/common.ts +0 -1
  510. package/src/src/ast/index.ts +0 -1
  511. package/src/src/ast/node.ts +0 -10
  512. package/src/src/ast/nodes/argument.test.ts +0 -43
  513. package/src/src/ast/nodes/argument.ts +0 -40
  514. package/src/src/ast/nodes/array-type.test.ts +0 -34
  515. package/src/src/ast/nodes/array-type.ts +0 -49
  516. package/src/src/ast/nodes/arrow-function.test.ts +0 -79
  517. package/src/src/ast/nodes/arrow-function.ts +0 -91
  518. package/src/src/ast/nodes/call.ts +0 -55
  519. package/src/src/ast/nodes/class.test.ts +0 -185
  520. package/src/src/ast/nodes/class.ts +0 -133
  521. package/src/src/ast/nodes/constructor-parameter.test.ts +0 -122
  522. package/src/src/ast/nodes/constructor-parameter.ts +0 -70
  523. package/src/src/ast/nodes/constructor.test.ts +0 -131
  524. package/src/src/ast/nodes/constructor.ts +0 -77
  525. package/src/src/ast/nodes/decorator.test.ts +0 -59
  526. package/src/src/ast/nodes/decorator.ts +0 -76
  527. package/src/src/ast/nodes/doc-tag.test.ts +0 -40
  528. package/src/src/ast/nodes/doc-tag.ts +0 -291
  529. package/src/src/ast/nodes/doc.test.ts +0 -40
  530. package/src/src/ast/nodes/doc.ts +0 -102
  531. package/src/src/ast/nodes/enum-value.test.ts +0 -66
  532. package/src/src/ast/nodes/enum-value.ts +0 -72
  533. package/src/src/ast/nodes/enum.test.ts +0 -85
  534. package/src/src/ast/nodes/enum.ts +0 -77
  535. package/src/src/ast/nodes/export.test.ts +0 -29
  536. package/src/src/ast/nodes/export.ts +0 -54
  537. package/src/src/ast/nodes/function-type.test.ts +0 -61
  538. package/src/src/ast/nodes/function-type.ts +0 -60
  539. package/src/src/ast/nodes/function.test.ts +0 -135
  540. package/src/src/ast/nodes/function.ts +0 -107
  541. package/src/src/ast/nodes/generic-parameter.test.ts +0 -86
  542. package/src/src/ast/nodes/generic-parameter.ts +0 -71
  543. package/src/src/ast/nodes/indexer.test.ts +0 -42
  544. package/src/src/ast/nodes/indexer.ts +0 -60
  545. package/src/src/ast/nodes/interface.test.ts +0 -142
  546. package/src/src/ast/nodes/interface.ts +0 -117
  547. package/src/src/ast/nodes/intersection-type.test.ts +0 -52
  548. package/src/src/ast/nodes/intersection-type.ts +0 -67
  549. package/src/src/ast/nodes/lookup-type.ts +0 -53
  550. package/src/src/ast/nodes/method.test.ts +0 -185
  551. package/src/src/ast/nodes/method.ts +0 -138
  552. package/src/src/ast/nodes/object-type.test.ts +0 -40
  553. package/src/src/ast/nodes/object-type.ts +0 -52
  554. package/src/src/ast/nodes/object.test.ts +0 -40
  555. package/src/src/ast/nodes/object.ts +0 -48
  556. package/src/src/ast/nodes/parameter.test.ts +0 -88
  557. package/src/src/ast/nodes/parameter.ts +0 -85
  558. package/src/src/ast/nodes/property-accessor.test.ts +0 -132
  559. package/src/src/ast/nodes/property-accessor.ts +0 -173
  560. package/src/src/ast/nodes/property.test.ts +0 -113
  561. package/src/src/ast/nodes/property.ts +0 -192
  562. package/src/src/ast/nodes/reference.test.ts +0 -42
  563. package/src/src/ast/nodes/reference.ts +0 -194
  564. package/src/src/ast/nodes/string.test.ts +0 -35
  565. package/src/src/ast/nodes/string.ts +0 -49
  566. package/src/src/ast/nodes/tuple.test.ts +0 -45
  567. package/src/src/ast/nodes/tuple.ts +0 -53
  568. package/src/src/ast/nodes/type-alias.test.ts +0 -35
  569. package/src/src/ast/nodes/type-alias.ts +0 -75
  570. package/src/src/ast/nodes/typeof.ts +0 -42
  571. package/src/src/ast/nodes/types.ts +0 -40
  572. package/src/src/ast/nodes/union-type.test.ts +0 -50
  573. package/src/src/ast/nodes/union-type.ts +0 -62
  574. package/src/src/ast/nodes/variable.test.ts +0 -49
  575. package/src/src/ast/nodes/variable.ts +0 -73
  576. package/src/src/ast/references/angular.ts +0 -24
  577. package/src/src/ast/references/easy-network-stub.ts +0 -21
  578. package/src/src/ast/references/index.ts +0 -5
  579. package/src/src/ast/references/k6.ts +0 -8
  580. package/src/src/ast/references/rxjs.ts +0 -7
  581. package/src/src/ast/references/typescript.ts +0 -35
  582. package/src/src/ast/utils/get-type-script-builder-options.ts +0 -19
  583. package/src/src/ast/utils/to-ts-node.ts +0 -27
  584. package/src/src/ast/utils/write-ts-generic-parameters.ts +0 -25
  585. package/src/src/ast/utils/write-ts-members.ts +0 -28
  586. package/src/src/ast/utils/write-ts-nodes.ts +0 -35
  587. package/src/src/ast/utils/write-ts-parameters.ts +0 -25
  588. package/src/src/common-results.ts +0 -26
  589. package/src/src/config.ts +0 -89
  590. package/src/src/file-builder.ts +0 -136
  591. package/src/src/generators/file-generator.ts +0 -15
  592. package/src/src/generators/index.ts +0 -6
  593. package/src/src/generators/models/index.ts +0 -3
  594. package/src/src/generators/models/model-generator.ts +0 -469
  595. package/src/src/generators/models/models-generator.ts +0 -108
  596. package/src/src/generators/models/models.ts +0 -105
  597. package/src/src/generators/services/angular-services/angular-service-generator.ts +0 -402
  598. package/src/src/generators/services/angular-services/angular-services-generator.ts +0 -295
  599. package/src/src/generators/services/angular-services/index.ts +0 -3
  600. package/src/src/generators/services/angular-services/models.ts +0 -270
  601. package/src/src/generators/services/angular-services/refs.ts +0 -54
  602. package/src/src/generators/services/easy-network-stub/easy-network-stub-generator.ts +0 -242
  603. package/src/src/generators/services/easy-network-stub/easy-network-stubs-generator.ts +0 -211
  604. package/src/src/generators/services/easy-network-stub/index.ts +0 -3
  605. package/src/src/generators/services/easy-network-stub/models.ts +0 -124
  606. package/src/src/generators/services/easy-network-stub/refs.ts +0 -45
  607. package/src/src/generators/services/fetch-clients/fetch-client-generator.ts +0 -267
  608. package/src/src/generators/services/fetch-clients/fetch-clients-generator.ts +0 -163
  609. package/src/src/generators/services/fetch-clients/index.ts +0 -3
  610. package/src/src/generators/services/fetch-clients/models.ts +0 -130
  611. package/src/src/generators/services/fetch-clients/refs.ts +0 -21
  612. package/src/src/generators/services/k6-clients/index.ts +0 -3
  613. package/src/src/generators/services/k6-clients/k6-client-generator.ts +0 -409
  614. package/src/src/generators/services/k6-clients/k6-clients-generator.ts +0 -165
  615. package/src/src/generators/services/k6-clients/models.ts +0 -241
  616. package/src/src/generators/services/k6-clients/refs.ts +0 -15
  617. package/src/src/import-collection.test.ts +0 -78
  618. package/src/src/import-collection.ts +0 -236
  619. package/src/src/utils.ts +0 -72
  620. package/src/tests/openapi-models.test.ts +0 -64
  621. package/test_runner.js +0 -239
@@ -1,1136 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.MockError = void 0;
5
- exports.mockSession = mockSession;
6
- exports.mockSessionAsync = mockSessionAsync;
7
- exports.restore = restore;
8
- exports.spy = spy;
9
- exports.stub = stub;
10
- exports.assertSpyCalls = assertSpyCalls;
11
- exports.assertSpyCall = assertSpyCall;
12
- exports.assertSpyCallAsync = assertSpyCallAsync;
13
- exports.assertSpyCallArg = assertSpyCallArg;
14
- exports.assertSpyCallArgs = assertSpyCallArgs;
15
- exports.returnsThis = returnsThis;
16
- exports.returnsArg = returnsArg;
17
- exports.returnsArgs = returnsArgs;
18
- exports.returnsNext = returnsNext;
19
- exports.resolvesNext = resolvesNext;
20
- const tslib_1 = require("tslib");
21
- /** A mocking and spying library.
22
- *
23
- * Test spies are function stand-ins that are used to assert if a function's
24
- * internal behavior matches expectations. Test spies on methods keep the original
25
- * behavior but allow you to test how the method is called and what it returns.
26
- * Test stubs are an extension of test spies that also replaces the original
27
- * methods behavior.
28
- *
29
- * ## Spying
30
- *
31
- * Say we have two functions, `square` and `multiply`, if we want to assert that
32
- * the `multiply` function is called during execution of the `square` function we
33
- * need a way to spy on the `multiply` function. There are a few ways to achieve
34
- * this with Spies, one is to have the `square` function take the `multiply`
35
- * multiply as a parameter.
36
- *
37
- * This way, we can call `square(multiply, value)` in the application code or wrap
38
- * a spy function around the `multiply` function and call
39
- * `square(multiplySpy, value)` in the testing code.
40
- *
41
- * ```ts
42
- * import {
43
- * assertSpyCall,
44
- * assertSpyCalls,
45
- * spy,
46
- * } from "@std/testing/mock";
47
- * import { assertEquals } from "@std/assert";
48
- *
49
- * function multiply(a: number, b: number): number {
50
- * return a * b;
51
- * }
52
- *
53
- * function square(
54
- * multiplyFn: (a: number, b: number) => number,
55
- * value: number,
56
- * ): number {
57
- * return multiplyFn(value, value);
58
- * }
59
- *
60
- * Deno.test("square calls multiply and returns results", () => {
61
- * const multiplySpy = spy(multiply);
62
- *
63
- * assertEquals(square(multiplySpy, 5), 25);
64
- *
65
- * // asserts that multiplySpy was called at least once and details about the first call.
66
- * assertSpyCall(multiplySpy, 0, {
67
- * args: [5, 5],
68
- * returned: 25,
69
- * });
70
- *
71
- * // asserts that multiplySpy was only called once.
72
- * assertSpyCalls(multiplySpy, 1);
73
- * });
74
- * ```
75
- *
76
- * If you prefer not adding additional parameters for testing purposes only, you
77
- * can use spy to wrap a method on an object instead. In the following example, the
78
- * exported `_internals` object has the `multiply` function we want to call as a
79
- * method and the `square` function calls `_internals.multiply` instead of
80
- * `multiply`.
81
- *
82
- * This way, we can call `square(value)` in both the application code and testing
83
- * code. Then spy on the `multiply` method on the `_internals` object in the
84
- * testing code to be able to spy on how the `square` function calls the `multiply`
85
- * function.
86
- *
87
- * ```ts
88
- * import {
89
- * assertSpyCall,
90
- * assertSpyCalls,
91
- * spy,
92
- * } from "@std/testing/mock";
93
- * import { assertEquals } from "@std/assert";
94
- *
95
- * function multiply(a: number, b: number): number {
96
- * return a * b;
97
- * }
98
- *
99
- * function square(value: number): number {
100
- * return _internals.multiply(value, value);
101
- * }
102
- *
103
- * const _internals = { multiply };
104
- *
105
- * Deno.test("square calls multiply and returns results", () => {
106
- * const multiplySpy = spy(_internals, "multiply");
107
- *
108
- * try {
109
- * assertEquals(square(5), 25);
110
- * } finally {
111
- * // unwraps the multiply method on the _internals object
112
- * multiplySpy.restore();
113
- * }
114
- *
115
- * // asserts that multiplySpy was called at least once and details about the first call.
116
- * assertSpyCall(multiplySpy, 0, {
117
- * args: [5, 5],
118
- * returned: 25,
119
- * });
120
- *
121
- * // asserts that multiplySpy was only called once.
122
- * assertSpyCalls(multiplySpy, 1);
123
- * });
124
- * ```
125
- *
126
- * One difference you may have noticed between these two examples is that in the
127
- * second we call the `restore` method on `multiplySpy` function. That is needed to
128
- * remove the spy wrapper from the `_internals` object's `multiply` method. The
129
- * `restore` method is called in a finally block to ensure that it is restored
130
- * whether or not the assertion in the try block is successful. The `restore`
131
- * method didn't need to be called in the first example because the `multiply`
132
- * function was not modified in any way like the `_internals` object was in the
133
- * second example.
134
- *
135
- * Method spys are disposable, meaning that you can have them automatically restore
136
- * themselves with the `using` keyword. Using this approach is cleaner because you
137
- * do not need to wrap your assertions in a try statement to ensure you restore the
138
- * methods before the tests finish.
139
- *
140
- * ```ts
141
- * import {
142
- * assertSpyCall,
143
- * assertSpyCalls,
144
- * spy,
145
- * } from "@std/testing/mock";
146
- * import { assertEquals } from "@std/assert";
147
- *
148
- * function multiply(a: number, b: number): number {
149
- * return a * b;
150
- * }
151
- *
152
- * function square(value: number): number {
153
- * return _internals.multiply(value, value);
154
- * }
155
- *
156
- * const _internals = { multiply };
157
- *
158
- * Deno.test("square calls multiply and returns results", () => {
159
- * using multiplySpy = spy(_internals, "multiply");
160
- *
161
- * assertEquals(square(5), 25);
162
- *
163
- * // asserts that multiplySpy was called at least once and details about the first call.
164
- * assertSpyCall(multiplySpy, 0, {
165
- * args: [5, 5],
166
- * returned: 25,
167
- * });
168
- *
169
- * // asserts that multiplySpy was only called once.
170
- * assertSpyCalls(multiplySpy, 1);
171
- * });
172
- * ```
173
- *
174
- * ## Stubbing
175
- *
176
- * Say we have two functions, `randomMultiple` and `randomInt`, if we want to
177
- * assert that `randomInt` is called during execution of `randomMultiple` we need a
178
- * way to spy on the `randomInt` function. That could be done with either of the
179
- * spying techniques previously mentioned. To be able to verify that the
180
- * `randomMultiple` function returns the value we expect it to for what `randomInt`
181
- * returns, the easiest way would be to replace the `randomInt` function's behavior
182
- * with more predictable behavior.
183
- *
184
- * You could use the first spying technique to do that but that would require
185
- * adding a `randomInt` parameter to the `randomMultiple` function.
186
- *
187
- * You could also use the second spying technique to do that, but your assertions
188
- * would not be as predictable due to the `randomInt` function returning random
189
- * values.
190
- *
191
- * Say we want to verify it returns correct values for both negative and positive
192
- * random integers. We could easily do that with stubbing. The below example is
193
- * similar to the second spying technique example but instead of passing the call
194
- * through to the original `randomInt` function, we are going to replace
195
- * `randomInt` with a function that returns pre-defined values.
196
- *
197
- * The mock module includes some helper functions to make creating common stubs
198
- * easy. The `returnsNext` function takes an array of values we want it to return
199
- * on consecutive calls.
200
- *
201
- * ```ts
202
- * import {
203
- * assertSpyCall,
204
- * assertSpyCalls,
205
- * returnsNext,
206
- * stub,
207
- * } from "@std/testing/mock";
208
- * import { assertEquals } from "@std/assert";
209
- *
210
- * function randomInt(lowerBound: number, upperBound: number): number {
211
- * return lowerBound + Math.floor(Math.random() * (upperBound - lowerBound));
212
- * }
213
- *
214
- * function randomMultiple(value: number): number {
215
- * return value * _internals.randomInt(-10, 10);
216
- * }
217
- *
218
- * const _internals = { randomInt };
219
- *
220
- * Deno.test("randomMultiple uses randomInt to generate random multiples between -10 and 10 times the value", () => {
221
- * const randomIntStub = stub(_internals, "randomInt", returnsNext([-3, 3]));
222
- *
223
- * try {
224
- * assertEquals(randomMultiple(5), -15);
225
- * assertEquals(randomMultiple(5), 15);
226
- * } finally {
227
- * // unwraps the randomInt method on the _internals object
228
- * randomIntStub.restore();
229
- * }
230
- *
231
- * // asserts that randomIntStub was called at least once and details about the first call.
232
- * assertSpyCall(randomIntStub, 0, {
233
- * args: [-10, 10],
234
- * returned: -3,
235
- * });
236
- * // asserts that randomIntStub was called at least twice and details about the second call.
237
- * assertSpyCall(randomIntStub, 1, {
238
- * args: [-10, 10],
239
- * returned: 3,
240
- * });
241
- *
242
- * // asserts that randomIntStub was only called twice.
243
- * assertSpyCalls(randomIntStub, 2);
244
- * });
245
- * ```
246
- *
247
- * Like method spys, stubs are disposable, meaning that you can have them automatically
248
- * restore themselves with the `using` keyword. Using this approach is cleaner because
249
- * you do not need to wrap your assertions in a try statement to ensure you restore the
250
- * methods before the tests finish.
251
- *
252
- * ```ts
253
- * import {
254
- * assertSpyCall,
255
- * assertSpyCalls,
256
- * returnsNext,
257
- * stub,
258
- * } from "@std/testing/mock";
259
- * import { assertEquals } from "@std/assert";
260
- *
261
- * function randomInt(lowerBound: number, upperBound: number): number {
262
- * return lowerBound + Math.floor(Math.random() * (upperBound - lowerBound));
263
- * }
264
- *
265
- * function randomMultiple(value: number): number {
266
- * return value * _internals.randomInt(-10, 10);
267
- * }
268
- *
269
- * const _internals = { randomInt };
270
- *
271
- * Deno.test("randomMultiple uses randomInt to generate random multiples between -10 and 10 times the value", () => {
272
- * using randomIntStub = stub(_internals, "randomInt", returnsNext([-3, 3]));
273
- *
274
- * assertEquals(randomMultiple(5), -15);
275
- * assertEquals(randomMultiple(5), 15);
276
- *
277
- * // asserts that randomIntStub was called at least once and details about the first call.
278
- * assertSpyCall(randomIntStub, 0, {
279
- * args: [-10, 10],
280
- * returned: -3,
281
- * });
282
- * // asserts that randomIntStub was called at least twice and details about the second call.
283
- * assertSpyCall(randomIntStub, 1, {
284
- * args: [-10, 10],
285
- * returned: 3,
286
- * });
287
- *
288
- * // asserts that randomIntStub was only called twice.
289
- * assertSpyCalls(randomIntStub, 2);
290
- * });
291
- * ```
292
- *
293
- * ## Faking time
294
- *
295
- * Say we have a function that has time based behavior that we would like to test.
296
- * With real time, that could cause tests to take much longer than they should. If
297
- * you fake time, you could simulate how your function would behave over time
298
- * starting from any point in time. Below is an example where we want to test that
299
- * the callback is called every second.
300
- *
301
- * With `FakeTime` we can do that. When the `FakeTime` instance is created, it
302
- * splits from real time. The `Date`, `setTimeout`, `clearTimeout`, `setInterval`
303
- * and `clearInterval` globals are replaced with versions that use the fake time
304
- * until real time is restored. You can control how time ticks forward with the
305
- * `tick` method on the `FakeTime` instance.
306
- *
307
- * ```ts
308
- * import {
309
- * assertSpyCalls,
310
- * spy,
311
- * } from "@std/testing/mock";
312
- * import { FakeTime } from "@std/testing/time";
313
- *
314
- * function secondInterval(cb: () => void): number {
315
- * return setInterval(cb, 1000);
316
- * }
317
- *
318
- * Deno.test("secondInterval calls callback every second and stops after being cleared", () => {
319
- * using time = new FakeTime();
320
- *
321
- * const cb = spy();
322
- * const intervalId = secondInterval(cb);
323
- * assertSpyCalls(cb, 0);
324
- * time.tick(500);
325
- * assertSpyCalls(cb, 0);
326
- * time.tick(500);
327
- * assertSpyCalls(cb, 1);
328
- * time.tick(3500);
329
- * assertSpyCalls(cb, 4);
330
- *
331
- * clearInterval(intervalId);
332
- * time.tick(1000);
333
- * assertSpyCalls(cb, 4);
334
- * });
335
- * ```
336
- *
337
- * @module
338
- */
339
- const equals_js_1 = require("../../assert/1.0.6/equals.js");
340
- const is_error_js_1 = require("../../assert/1.0.6/is_error.js");
341
- const rejects_js_1 = require("../../assert/1.0.6/rejects.js");
342
- const assertion_error_js_1 = require("../../assert/1.0.6/assertion_error.js");
343
- /**
344
- * An error related to spying on a function or instance method.
345
- *
346
- * @example Usage
347
- * ```ts
348
- * import { MockError, spy } from "@std/testing/mock";
349
- * import { assertThrows } from "@std/assert";
350
- *
351
- * assertThrows(() => {
352
- * spy({} as any, "no-such-method");
353
- * }, MockError);
354
- * ```
355
- */
356
- class MockError extends Error {
357
- /**
358
- * Construct MockError
359
- *
360
- * @param message The error message.
361
- */
362
- constructor(message) {
363
- super(message);
364
- this.name = "MockError";
365
- }
366
- }
367
- exports.MockError = MockError;
368
- /** Wraps a function with a Spy. */
369
- function functionSpy(func) {
370
- const original = func !== null && func !== void 0 ? func : (() => { });
371
- const calls = [];
372
- const spy = function (...args) {
373
- const call = { args };
374
- if (this)
375
- call.self = this;
376
- try {
377
- call.returned = original.apply(this, args);
378
- }
379
- catch (error) {
380
- call.error = error;
381
- calls.push(call);
382
- throw error;
383
- }
384
- calls.push(call);
385
- return call.returned;
386
- };
387
- Object.defineProperties(spy, {
388
- original: {
389
- enumerable: true,
390
- value: original,
391
- },
392
- calls: {
393
- enumerable: true,
394
- value: calls,
395
- },
396
- restored: {
397
- enumerable: true,
398
- get: () => false,
399
- },
400
- restore: {
401
- enumerable: true,
402
- value: () => {
403
- throw new MockError("Cannot restore: function cannot be restored");
404
- },
405
- },
406
- });
407
- return spy;
408
- }
409
- /**
410
- * Checks if a function is a spy.
411
- *
412
- * @typeParam Self The self type of the function.
413
- * @typeParam Args The arguments type of the function.
414
- * @typeParam Return The return type of the function.
415
- * @param func The function to check
416
- * @return `true` if the function is a spy, `false` otherwise.
417
- */
418
- function isSpy(func) {
419
- const spy = func;
420
- return typeof spy === "function" &&
421
- typeof spy.original === "function" &&
422
- typeof spy.restored === "boolean" &&
423
- typeof spy.restore === "function" &&
424
- Array.isArray(spy.calls);
425
- }
426
- // deno-lint-ignore no-explicit-any
427
- const sessions = [];
428
- // deno-lint-ignore no-explicit-any
429
- function getSession() {
430
- if (sessions.length === 0)
431
- sessions.push(new Set());
432
- return sessions.at(-1);
433
- }
434
- // deno-lint-ignore no-explicit-any
435
- function registerMock(spy) {
436
- const session = getSession();
437
- session.add(spy);
438
- }
439
- // deno-lint-ignore no-explicit-any
440
- function unregisterMock(spy) {
441
- const session = getSession();
442
- session.delete(spy);
443
- }
444
- function mockSession(func) {
445
- if (func) {
446
- return function (...args) {
447
- const id = sessions.length;
448
- sessions.push(new Set());
449
- try {
450
- return func.apply(this, args);
451
- }
452
- finally {
453
- restore(id);
454
- }
455
- };
456
- }
457
- else {
458
- sessions.push(new Set());
459
- return sessions.length - 1;
460
- }
461
- }
462
- /**
463
- * Creates an async session that tracks all mocks created before the promise resolves.
464
- *
465
- * @example Usage
466
- * ```ts
467
- * import { mockSessionAsync, restore, stub } from "@std/testing/mock";
468
- * import { assertEquals, assertNotEquals } from "@std/assert";
469
- *
470
- * const setTimeout = globalThis.setTimeout;
471
- * const session = mockSessionAsync(async () => {
472
- * stub(globalThis, "setTimeout");
473
- * assertNotEquals(globalThis.setTimeout, setTimeout);
474
- * });
475
- *
476
- * await session();
477
- *
478
- * assertEquals(globalThis.setTimeout, setTimeout); // stub is restored
479
- * ```
480
- * @typeParam Self The self type of the function.
481
- * @typeParam Args The arguments type of the function.
482
- * @typeParam Return The return type of the function.
483
- * @param func The function.
484
- * @returns The return value of the function.
485
- */
486
- function mockSessionAsync(func) {
487
- return async function (...args) {
488
- const id = sessions.length;
489
- sessions.push(new Set());
490
- try {
491
- return await func.apply(this, args);
492
- }
493
- finally {
494
- restore(id);
495
- }
496
- };
497
- }
498
- /**
499
- * Restores all mocks registered in the current session that have not already been restored.
500
- * If an id is provided, it will restore all mocks registered in the session associed with that id that have not already been restored.
501
- *
502
- * @example Usage
503
- * ```ts
504
- * import { mockSession, restore, stub } from "@std/testing/mock";
505
- * import { assertEquals, assertNotEquals } from "@std/assert";
506
- *
507
- * const setTimeout = globalThis.setTimeout;
508
- *
509
- * stub(globalThis, "setTimeout");
510
- *
511
- * assertNotEquals(globalThis.setTimeout, setTimeout);
512
- *
513
- * restore();
514
- *
515
- * assertEquals(globalThis.setTimeout, setTimeout);
516
- * ```
517
- *
518
- * @param id The id of the session to restore. If not provided, all mocks registered in the current session are restored.
519
- */
520
- function restore(id) {
521
- id !== null && id !== void 0 ? id : (id = (sessions.length || 1) - 1);
522
- while (id < sessions.length) {
523
- const session = sessions.pop();
524
- if (session) {
525
- for (const value of session) {
526
- value.restore();
527
- }
528
- }
529
- }
530
- }
531
- /** Wraps an instance method with a Spy. */
532
- function methodSpy(self, property) {
533
- var _a, _b;
534
- if (typeof self[property] !== "function") {
535
- throw new MockError("Cannot spy: property is not an instance method");
536
- }
537
- if (isSpy(self[property])) {
538
- throw new MockError("Cannot spy: already spying on instance method");
539
- }
540
- const propertyDescriptor = Object.getOwnPropertyDescriptor(self, property);
541
- if (propertyDescriptor && !propertyDescriptor.configurable) {
542
- throw new MockError("Cannot spy: non-configurable instance method");
543
- }
544
- const original = self[property];
545
- const calls = [];
546
- let restored = false;
547
- const spy = function (...args) {
548
- const call = { args };
549
- if (this)
550
- call.self = this;
551
- try {
552
- call.returned = original.apply(this, args);
553
- }
554
- catch (error) {
555
- call.error = error;
556
- calls.push(call);
557
- throw error;
558
- }
559
- calls.push(call);
560
- return call.returned;
561
- };
562
- Object.defineProperties(spy, {
563
- original: {
564
- enumerable: true,
565
- value: original,
566
- },
567
- calls: {
568
- enumerable: true,
569
- value: calls,
570
- },
571
- restored: {
572
- enumerable: true,
573
- get: () => restored,
574
- },
575
- restore: {
576
- enumerable: true,
577
- value: () => {
578
- if (restored) {
579
- throw new MockError("Cannot restore: instance method already restored");
580
- }
581
- if (propertyDescriptor) {
582
- Object.defineProperty(self, property, propertyDescriptor);
583
- }
584
- else {
585
- delete self[property];
586
- }
587
- restored = true;
588
- unregisterMock(spy);
589
- },
590
- },
591
- [Symbol.dispose]: {
592
- value: () => {
593
- spy.restore();
594
- },
595
- },
596
- });
597
- Object.defineProperty(self, property, {
598
- configurable: true,
599
- enumerable: (_a = propertyDescriptor === null || propertyDescriptor === void 0 ? void 0 : propertyDescriptor.enumerable) !== null && _a !== void 0 ? _a : false,
600
- writable: (_b = propertyDescriptor === null || propertyDescriptor === void 0 ? void 0 : propertyDescriptor.writable) !== null && _b !== void 0 ? _b : false,
601
- value: spy,
602
- });
603
- registerMock(spy);
604
- return spy;
605
- }
606
- /** Wraps a constructor with a Spy. */
607
- function constructorSpy(constructor) {
608
- var _a;
609
- const original = constructor;
610
- const calls = [];
611
- // @ts-ignore TS2509: Can't know the type of `original` statically.
612
- const spy = (_a = class extends original {
613
- // deno-lint-ignore constructor-super
614
- constructor(...args) {
615
- const call = { args };
616
- try {
617
- super(...args);
618
- call.returned = this;
619
- }
620
- catch (error) {
621
- call.error = error;
622
- calls.push(call);
623
- throw error;
624
- }
625
- calls.push(call);
626
- }
627
- static restore() {
628
- throw new MockError("Cannot restore: constructor cannot be restored");
629
- }
630
- },
631
- tslib_1.__setFunctionName(_a, "spy"),
632
- Object.defineProperty(_a, "name", {
633
- enumerable: true,
634
- configurable: true,
635
- writable: true,
636
- value: original.name
637
- }),
638
- Object.defineProperty(_a, "original", {
639
- enumerable: true,
640
- configurable: true,
641
- writable: true,
642
- value: original
643
- }),
644
- Object.defineProperty(_a, "calls", {
645
- enumerable: true,
646
- configurable: true,
647
- writable: true,
648
- value: calls
649
- }),
650
- Object.defineProperty(_a, "restored", {
651
- enumerable: true,
652
- configurable: true,
653
- writable: true,
654
- value: false
655
- }),
656
- _a);
657
- return spy;
658
- }
659
- function spy(funcOrConstOrSelf, property) {
660
- if (!funcOrConstOrSelf) {
661
- return functionSpy();
662
- }
663
- else if (property !== undefined) {
664
- return methodSpy(funcOrConstOrSelf, property);
665
- }
666
- else if (funcOrConstOrSelf.toString().startsWith("class")) {
667
- return constructorSpy(funcOrConstOrSelf);
668
- }
669
- else {
670
- return functionSpy(funcOrConstOrSelf);
671
- }
672
- }
673
- function stub(self, property, func) {
674
- var _a, _b;
675
- if (self[property] !== undefined && typeof self[property] !== "function") {
676
- throw new MockError("Cannot stub: property is not an instance method");
677
- }
678
- if (isSpy(self[property])) {
679
- throw new MockError("Cannot stub: already spying on instance method");
680
- }
681
- const propertyDescriptor = Object.getOwnPropertyDescriptor(self, property);
682
- if (propertyDescriptor && !propertyDescriptor.configurable) {
683
- throw new MockError("Cannot stub: non-configurable instance method");
684
- }
685
- const fake = func !== null && func !== void 0 ? func : (() => { });
686
- const original = self[property];
687
- const calls = [];
688
- let restored = false;
689
- const stub = function (...args) {
690
- const call = { args };
691
- if (this)
692
- call.self = this;
693
- try {
694
- call.returned = fake.apply(this, args);
695
- }
696
- catch (error) {
697
- call.error = error;
698
- calls.push(call);
699
- throw error;
700
- }
701
- calls.push(call);
702
- return call.returned;
703
- };
704
- Object.defineProperties(stub, {
705
- original: {
706
- enumerable: true,
707
- value: original,
708
- },
709
- fake: {
710
- enumerable: true,
711
- value: fake,
712
- },
713
- calls: {
714
- enumerable: true,
715
- value: calls,
716
- },
717
- restored: {
718
- enumerable: true,
719
- get: () => restored,
720
- },
721
- restore: {
722
- enumerable: true,
723
- value: () => {
724
- if (restored) {
725
- throw new MockError("Cannot restore: instance method already restored");
726
- }
727
- if (propertyDescriptor) {
728
- Object.defineProperty(self, property, propertyDescriptor);
729
- }
730
- else {
731
- delete self[property];
732
- }
733
- restored = true;
734
- unregisterMock(stub);
735
- },
736
- },
737
- [Symbol.dispose]: {
738
- value: () => {
739
- stub.restore();
740
- },
741
- },
742
- });
743
- Object.defineProperty(self, property, {
744
- configurable: true,
745
- enumerable: (_a = propertyDescriptor === null || propertyDescriptor === void 0 ? void 0 : propertyDescriptor.enumerable) !== null && _a !== void 0 ? _a : false,
746
- writable: (_b = propertyDescriptor === null || propertyDescriptor === void 0 ? void 0 : propertyDescriptor.writable) !== null && _b !== void 0 ? _b : false,
747
- value: stub,
748
- });
749
- registerMock(stub);
750
- return stub;
751
- }
752
- /**
753
- * Asserts that a spy is called as much as expected and no more.
754
- *
755
- * @example Usage
756
- * ```ts
757
- * import { assertSpyCalls, spy } from "@std/testing/mock";
758
- *
759
- * const func = spy();
760
- *
761
- * func();
762
- * func();
763
- *
764
- * assertSpyCalls(func, 2);
765
- * ```
766
- *
767
- * @typeParam Self The self type of the spy function.
768
- * @typeParam Args The arguments type of the spy function.
769
- * @typeParam Return The return type of the spy function.
770
- * @param spy The spy to check
771
- * @param expectedCalls The number of the expected calls.
772
- */
773
- function assertSpyCalls(spy, expectedCalls) {
774
- try {
775
- (0, equals_js_1.assertEquals)(spy.calls.length, expectedCalls);
776
- }
777
- catch (e) {
778
- (0, is_error_js_1.assertIsError)(e);
779
- let message = spy.calls.length < expectedCalls
780
- ? "Spy not called as much as expected:\n"
781
- : "Spy called more than expected:\n";
782
- message += e.message.split("\n").slice(1).join("\n");
783
- throw new assertion_error_js_1.AssertionError(message);
784
- }
785
- }
786
- function getSpyCall(spy, callIndex) {
787
- if (spy.calls.length < (callIndex + 1)) {
788
- throw new assertion_error_js_1.AssertionError("Spy not called as much as expected");
789
- }
790
- return spy.calls[callIndex];
791
- }
792
- /**
793
- * Asserts that a spy is called as expected.
794
- *
795
- * @example Usage
796
- * ```ts
797
- * import { assertSpyCall, spy } from "@std/testing/mock";
798
- *
799
- * const func = spy((a: number, b: number) => a + b);
800
- *
801
- * func(3, 4);
802
- * func(5, 6);
803
- *
804
- * // asserts each call made to the spy function.
805
- * assertSpyCall(func, 0, { args: [3, 4], returned: 7 });
806
- * assertSpyCall(func, 1, { args: [5, 6], returned: 11 });
807
- * ```
808
- *
809
- * @typeParam Self The self type of the spy function.
810
- * @typeParam Args The arguments type of the spy function.
811
- * @typeParam Return The return type of the spy function.
812
- * @param spy The spy to check
813
- * @param callIndex The index of the call to check
814
- * @param expected The expected spy call.
815
- */
816
- function assertSpyCall(spy, callIndex, expected) {
817
- var _a, _b;
818
- const call = getSpyCall(spy, callIndex);
819
- if (expected) {
820
- if (expected.args) {
821
- try {
822
- (0, equals_js_1.assertEquals)(call.args, expected.args);
823
- }
824
- catch (e) {
825
- (0, is_error_js_1.assertIsError)(e);
826
- throw new assertion_error_js_1.AssertionError("Spy not called with expected args:\n" +
827
- e.message.split("\n").slice(1).join("\n"));
828
- }
829
- }
830
- if ("self" in expected) {
831
- try {
832
- (0, equals_js_1.assertEquals)(call.self, expected.self);
833
- }
834
- catch (e) {
835
- (0, is_error_js_1.assertIsError)(e);
836
- let message = expected.self
837
- ? "Spy not called as method on expected self:\n"
838
- : "Spy not expected to be called as method on object:\n";
839
- message += e.message.split("\n").slice(1).join("\n");
840
- throw new assertion_error_js_1.AssertionError(message);
841
- }
842
- }
843
- if ("returned" in expected) {
844
- if ("error" in expected) {
845
- throw new TypeError("Do not expect error and return, only one should be expected");
846
- }
847
- if (call.error) {
848
- throw new assertion_error_js_1.AssertionError("Spy call did not return expected value, an error was thrown.");
849
- }
850
- try {
851
- (0, equals_js_1.assertEquals)(call.returned, expected.returned);
852
- }
853
- catch (e) {
854
- (0, is_error_js_1.assertIsError)(e);
855
- throw new assertion_error_js_1.AssertionError("Spy call did not return expected value:\n" +
856
- e.message.split("\n").slice(1).join("\n"));
857
- }
858
- }
859
- if ("error" in expected) {
860
- if ("returned" in call) {
861
- throw new assertion_error_js_1.AssertionError("Spy call did not throw an error, a value was returned.");
862
- }
863
- (0, is_error_js_1.assertIsError)(call.error, (_a = expected.error) === null || _a === void 0 ? void 0 : _a.Class, (_b = expected.error) === null || _b === void 0 ? void 0 : _b.msgIncludes);
864
- }
865
- }
866
- }
867
- /**
868
- * Asserts that an async spy is called as expected.
869
- *
870
- * @example Usage
871
- * ```ts
872
- * import { assertSpyCallAsync, spy } from "@std/testing/mock";
873
- *
874
- * const func = spy((a: number, b: number) => new Promise((resolve) => {
875
- * setTimeout(() => resolve(a + b), 100)
876
- * }));
877
- *
878
- * await func(3, 4);
879
- * await func(5, 6);
880
- *
881
- * // asserts each call made to the spy function.
882
- * await assertSpyCallAsync(func, 0, { args: [3, 4], returned: 7 });
883
- * await assertSpyCallAsync(func, 1, { args: [5, 6], returned: 11 });
884
- * ```
885
- *
886
- * @typeParam Self The self type of the spy function.
887
- * @typeParam Args The arguments type of the spy function.
888
- * @typeParam Return The return type of the spy function.
889
- * @param spy The spy to check
890
- * @param callIndex The index of the call to check
891
- * @param expected The expected spy call.
892
- */
893
- async function assertSpyCallAsync(spy, callIndex, expected) {
894
- var _a, _b, _c, _d;
895
- const expectedSync = expected && { ...expected };
896
- if (expectedSync) {
897
- delete expectedSync.returned;
898
- delete expectedSync.error;
899
- }
900
- assertSpyCall(spy, callIndex, expectedSync);
901
- const call = getSpyCall(spy, callIndex);
902
- if (call.error) {
903
- throw new assertion_error_js_1.AssertionError("Spy call did not return a promise, an error was thrown.");
904
- }
905
- if (call.returned !== Promise.resolve(call.returned)) {
906
- throw new assertion_error_js_1.AssertionError("Spy call did not return a promise, a value was returned.");
907
- }
908
- if (expected) {
909
- if ("returned" in expected) {
910
- if ("error" in expected) {
911
- throw new TypeError("Do not expect error and return, only one should be expected");
912
- }
913
- let expectedResolved;
914
- try {
915
- expectedResolved = await expected.returned;
916
- }
917
- catch (_e) {
918
- throw new TypeError("Do not expect rejected promise, expect error instead");
919
- }
920
- let resolved;
921
- try {
922
- resolved = await call.returned;
923
- }
924
- catch (_f) {
925
- throw new assertion_error_js_1.AssertionError("Spy call returned promise was rejected");
926
- }
927
- try {
928
- (0, equals_js_1.assertEquals)(resolved, expectedResolved);
929
- }
930
- catch (e) {
931
- (0, is_error_js_1.assertIsError)(e);
932
- throw new assertion_error_js_1.AssertionError("Spy call did not resolve to expected value:\n" +
933
- e.message.split("\n").slice(1).join("\n"));
934
- }
935
- }
936
- if ("error" in expected) {
937
- await (0, rejects_js_1.assertRejects)(() => Promise.resolve(call.returned), (_b = (_a = expected.error) === null || _a === void 0 ? void 0 : _a.Class) !== null && _b !== void 0 ? _b : Error, (_d = (_c = expected.error) === null || _c === void 0 ? void 0 : _c.msgIncludes) !== null && _d !== void 0 ? _d : "");
938
- }
939
- }
940
- }
941
- /**
942
- * Asserts that a spy is called with a specific arg as expected.
943
- *
944
- * @example Usage
945
- * ```ts
946
- * import { assertSpyCallArg, spy } from "@std/testing/mock";
947
- *
948
- * const func = spy((a: number, b: number) => a + b);
949
- *
950
- * func(3, 4);
951
- * func(5, 6);
952
- *
953
- * // asserts each call made to the spy function.
954
- * assertSpyCallArg(func, 0, 0, 3);
955
- * assertSpyCallArg(func, 0, 1, 4);
956
- * assertSpyCallArg(func, 1, 0, 5);
957
- * assertSpyCallArg(func, 1, 1, 6);
958
- * ```
959
- *
960
- * @typeParam Self The self type of the spy function.
961
- * @typeParam Args The arguments type of the spy function.
962
- * @typeParam Return The return type of the spy function.
963
- * @typeParam ExpectedArg The expected type of the argument for the spy to be called.
964
- * @param spy The spy to check.
965
- * @param callIndex The index of the call to check.
966
- * @param argIndex The index of the arguments to check.
967
- * @param expected The expected argument.
968
- * @returns The actual argument.
969
- */
970
- function assertSpyCallArg(spy, callIndex, argIndex, expected) {
971
- const call = getSpyCall(spy, callIndex);
972
- const arg = call === null || call === void 0 ? void 0 : call.args[argIndex];
973
- (0, equals_js_1.assertEquals)(arg, expected);
974
- return arg;
975
- }
976
- function assertSpyCallArgs(spy, callIndex, argsStart, argsEnd, expected) {
977
- const call = getSpyCall(spy, callIndex);
978
- if (!expected) {
979
- expected = argsEnd;
980
- argsEnd = undefined;
981
- }
982
- if (!expected) {
983
- expected = argsStart;
984
- argsStart = undefined;
985
- }
986
- const args = typeof argsEnd === "number"
987
- ? call.args.slice(argsStart, argsEnd)
988
- : typeof argsStart === "number"
989
- ? call.args.slice(argsStart)
990
- : call.args;
991
- (0, equals_js_1.assertEquals)(args, expected);
992
- return args;
993
- }
994
- /**
995
- * Creates a function that returns the instance the method was called on.
996
- *
997
- * @example Usage
998
- * ```ts
999
- * import { returnsThis } from "@std/testing/mock";
1000
- * import { assertEquals } from "@std/assert";
1001
- *
1002
- * const func = returnsThis();
1003
- * const obj = { func };
1004
- * assertEquals(obj.func(), obj);
1005
- * ```
1006
- *
1007
- * @typeParam Self The self type of the returned function.
1008
- * @typeParam Args The arguments type of the returned function.
1009
- * @returns A function that returns the instance the method was called on.
1010
- */
1011
- function returnsThis() {
1012
- return function () {
1013
- return this;
1014
- };
1015
- }
1016
- /**
1017
- * Creates a function that returns one of its arguments.
1018
- *
1019
- * @example Usage
1020
- * ```ts
1021
- * import { returnsArg } from "@std/testing/mock";
1022
- * import { assertEquals } from "@std/assert";
1023
- *
1024
- * const func = returnsArg(1);
1025
- * assertEquals(func(1, 2, 3), 2);
1026
- * ```
1027
- *
1028
- * @typeParam Arg The type of returned argument.
1029
- * @typeParam Self The self type of the returned function.
1030
- * @param idx The index of the arguments to use.
1031
- * @returns A function that returns one of its arguments.
1032
- */
1033
- function returnsArg(idx) {
1034
- return function (...args) {
1035
- return args[idx];
1036
- };
1037
- }
1038
- /**
1039
- * Creates a function that returns its arguments or a subset of them. If end is specified, it will return arguments up to but not including the end.
1040
- *
1041
- * @example Usage
1042
- * ```ts
1043
- * import { returnsArgs } from "@std/testing/mock";
1044
- * import { assertEquals } from "@std/assert";
1045
- *
1046
- * const func = returnsArgs();
1047
- * assertEquals(func(1, 2, 3), [1, 2, 3]);
1048
- * ```
1049
- *
1050
- * @typeParam Args The arguments type of the returned function
1051
- * @typeParam Self The self type of the returned function
1052
- * @param start The start index of the arguments to return. Default is 0.
1053
- * @param end The end index of the arguments to return.
1054
- * @returns A function that returns its arguments or a subset of them.
1055
- */
1056
- function returnsArgs(start = 0, end) {
1057
- return function (...args) {
1058
- return args.slice(start, end);
1059
- };
1060
- }
1061
- /**
1062
- * Creates a function that returns the iterable values. Any iterable values that are errors will be thrown.
1063
- *
1064
- * @example Usage
1065
- * ```ts
1066
- * import { returnsNext } from "@std/testing/mock";
1067
- * import { assertEquals, assertThrows } from "@std/assert";
1068
- *
1069
- * const func = returnsNext([1, 2, new Error("foo"), 3]);
1070
- * assertEquals(func(), 1);
1071
- * assertEquals(func(), 2);
1072
- * assertThrows(() => func(), Error, "foo");
1073
- * assertEquals(func(), 3);
1074
- * ```
1075
- *
1076
- * @typeParam Return The type of each item of the iterable
1077
- * @typeParam Self The self type of the returned function
1078
- * @typeParam Args The arguments type of the returned function
1079
- * @param values The iterable values
1080
- * @return A function that returns the iterable values
1081
- */
1082
- function returnsNext(values) {
1083
- const gen = (function* returnsValue() {
1084
- yield* values;
1085
- })();
1086
- let calls = 0;
1087
- return function () {
1088
- const next = gen.next();
1089
- if (next.done) {
1090
- throw new MockError(`Not expected to be called more than ${calls} time(s)`);
1091
- }
1092
- calls++;
1093
- const { value } = next;
1094
- if (value instanceof Error)
1095
- throw value;
1096
- return value;
1097
- };
1098
- }
1099
- /**
1100
- * Creates a function that resolves the awaited iterable values. Any awaited iterable values that are errors will be thrown.
1101
- *
1102
- * @example Usage
1103
- * ```ts
1104
- * import { resolvesNext } from "@std/testing/mock";
1105
- * import { assertEquals, assertRejects } from "@std/assert";
1106
- *
1107
- * const func = resolvesNext([1, 2, new Error("foo"), 3]);
1108
- * assertEquals(await func(), 1);
1109
- * assertEquals(await func(), 2);
1110
- * assertRejects(() => func(), Error, "foo");
1111
- * assertEquals(await func(), 3);
1112
- * ```
1113
- *
1114
- * @typeParam Return The type of each item of the iterable
1115
- * @typeParam Self The self type of the returned function
1116
- * @typeParam Args The type of arguments of the returned function
1117
- * @param iterable The iterable to use
1118
- * @returns A function that resolves the awaited iterable values
1119
- */
1120
- function resolvesNext(iterable) {
1121
- const gen = (async function* returnsValue() {
1122
- yield* iterable;
1123
- })();
1124
- let calls = 0;
1125
- return async function () {
1126
- const next = await gen.next();
1127
- if (next.done) {
1128
- throw new MockError(`Not expected to be called more than ${calls} time(s)`);
1129
- }
1130
- calls++;
1131
- const { value } = next;
1132
- if (value instanceof Error)
1133
- throw value;
1134
- return value;
1135
- };
1136
- }