testeranto 0.189.0 → 0.198.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (769) hide show
  1. package/.vscode/settings.json +7 -2
  2. package/ALL_LICENSES.txt +11246 -0
  3. package/LICENSE +21 -0
  4. package/default-project.json +44 -0
  5. package/design-editor/DesignEditor.tsx +251 -0
  6. package/design-editor/index.ts +2 -0
  7. package/design-editor/server.ts +121 -0
  8. package/design-editor/types.ts +16 -0
  9. package/designs/default-project.json +210 -0
  10. package/dist/common/design-editor/DesignEditor.js +242 -0
  11. package/dist/common/design-editor/index.js +18 -0
  12. package/dist/common/design-editor/server.js +98 -0
  13. package/dist/common/src/App.js +40 -6
  14. package/dist/common/src/Node.js +3 -2
  15. package/dist/common/src/PM/PM_WithEslintAndTsc.js +8 -1
  16. package/dist/common/src/PM/base.js +1 -0
  17. package/dist/common/src/PM/main.js +371 -5
  18. package/dist/common/src/PM/node.js +4 -2
  19. package/dist/common/src/PM/pure.js +15 -57
  20. package/dist/common/src/PM/web.js +5 -3
  21. package/dist/common/src/Pure.js +2 -2
  22. package/dist/common/src/Pure.test.js +46 -78
  23. package/dist/common/src/ReportServer.js +8 -2
  24. package/dist/common/src/Web.js +2 -2
  25. package/dist/common/src/build.js +1 -1
  26. package/dist/common/src/components/DesignEditorPage.js +205 -0
  27. package/dist/common/src/components/pure/AppFrame.js +62 -13
  28. package/dist/common/src/components/pure/ModalContent.test/implementation.js +13 -11
  29. package/dist/common/src/components/pure/ModalContent.test/index.js +48 -2
  30. package/dist/common/src/components/pure/ModalContent.test/specification.js +2 -2
  31. package/dist/common/src/components/pure/NavBar.js +9 -10
  32. package/dist/common/src/components/pure/ProcessManager.js +112 -0
  33. package/dist/common/src/components/pure/ProcessManagerView.js +237 -0
  34. package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +134 -106
  35. package/dist/common/src/components/pure/ProjectsPageView.js +18 -12
  36. package/dist/common/src/components/pure/SettingsButton.js +4 -74
  37. package/dist/common/src/components/pure/SingleProcessView.js +214 -0
  38. package/dist/common/src/components/pure/TestPageView.js +457 -78
  39. package/dist/common/src/components/pure/TestPageView.test/implementation.js +90 -135
  40. package/dist/common/src/components/stateful/FeaturesReporter.js +1 -1
  41. package/dist/common/src/components/stateful/FileTree.js +40 -0
  42. package/dist/common/src/components/stateful/ProcessManagerPage.js +112 -0
  43. package/dist/common/src/components/stateful/ProjectPage.js +6 -5
  44. package/dist/common/src/components/stateful/ProjectsPage.js +32 -6
  45. package/dist/common/src/components/stateful/SettingsPage.js +72 -0
  46. package/dist/common/src/components/stateful/SingleProcessPage.js +147 -0
  47. package/dist/common/src/components/stateful/TestPage.js +104 -8
  48. package/dist/common/src/components/stateful/TextEditorPage.js +154 -0
  49. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +3 -4
  50. package/dist/common/src/lib/{abstractBase.js → BaseGiven.js} +14 -91
  51. package/dist/common/src/lib/BaseSuite.js +6 -3
  52. package/dist/common/src/lib/BaseSuite.test/mock.js +25 -34
  53. package/dist/common/src/lib/BaseSuite.test/test.js +33 -31
  54. package/dist/common/src/lib/BaseThen.js +64 -0
  55. package/dist/common/src/lib/BaseWhen.js +45 -0
  56. package/dist/common/src/lib/Tiposkripto.js +149 -0
  57. package/dist/common/src/lib/{core.test/MockCore.js → Tiposkripto.test/MockTiposkripto.js} +5 -8
  58. package/dist/common/src/lib/{core.test/core.test.adapter.js → Tiposkripto.test/Tiposkripto.adapter.js} +10 -8
  59. package/dist/common/src/lib/{classBuilder.test/classBuilder.test.implementation.js → Tiposkripto.test/Tiposkripto.implementation.js} +44 -61
  60. package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.js +11 -0
  61. package/dist/common/src/lib/{classBuilder.test/classBuilder.test.specification.js → Tiposkripto.test/Tiposkripto.specification.js} +13 -9
  62. package/dist/common/src/lib/abstractBase.test/MockGiven.js +10 -3
  63. package/dist/common/src/lib/abstractBase.test/MockThen.js +6 -3
  64. package/dist/common/src/lib/abstractBase.test/MockWhen.js +10 -3
  65. package/dist/common/src/lib/abstractBase.test/adapter.js +18 -6
  66. package/dist/common/src/lib/abstractBase.test/implementation.js +3 -3
  67. package/dist/common/src/lib/index.js +11 -14
  68. package/dist/common/src/lib/mocks.test.js +10 -8
  69. package/dist/common/src/lib/pmProxy.js +37 -14
  70. package/dist/common/src/lib/pmProxy.test/adapter.js +12 -2
  71. package/dist/common/src/lib/pmProxy.test/implementation.js +73 -43
  72. package/dist/common/src/lib/pmProxy.test/specification.js +3 -0
  73. package/dist/common/src/run.js +15 -4
  74. package/dist/common/src/utils/api.js +44 -33
  75. package/dist/common/src/utils/logFiles.js +48 -22
  76. package/dist/common/src/utils/makePrompt.js +5 -4
  77. package/dist/common/testeranto.config.js +19 -41
  78. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  79. package/dist/module/design-editor/DesignEditor.js +206 -0
  80. package/dist/module/design-editor/index.js +2 -0
  81. package/dist/module/design-editor/server.js +92 -0
  82. package/dist/module/src/App.js +40 -6
  83. package/dist/module/src/Node.js +3 -2
  84. package/dist/module/src/PM/PM_WithEslintAndTsc.js +8 -1
  85. package/dist/module/src/PM/base.js +1 -0
  86. package/dist/module/src/PM/main.js +371 -5
  87. package/dist/module/src/PM/node.js +4 -2
  88. package/dist/module/src/PM/pure.js +15 -57
  89. package/dist/module/src/PM/web.js +5 -3
  90. package/dist/module/src/Pure.js +2 -2
  91. package/dist/module/src/Pure.test.js +46 -78
  92. package/dist/module/src/ReportServer.js +8 -2
  93. package/dist/module/src/Web.js +2 -2
  94. package/dist/module/src/build.js +1 -1
  95. package/dist/module/src/components/DesignEditorPage.js +168 -0
  96. package/dist/module/src/components/pure/AppFrame.js +30 -11
  97. package/dist/module/src/components/pure/ModalContent.test/implementation.js +13 -11
  98. package/dist/module/src/components/pure/ModalContent.test/index.js +48 -2
  99. package/dist/module/src/components/pure/ModalContent.test/specification.js +2 -2
  100. package/dist/module/src/components/pure/NavBar.js +10 -11
  101. package/dist/module/src/components/pure/ProcessManager.js +75 -0
  102. package/dist/module/src/components/pure/ProcessManagerView.js +200 -0
  103. package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +134 -106
  104. package/dist/module/src/components/pure/ProjectsPageView.js +20 -14
  105. package/dist/module/src/components/pure/SettingsButton.js +5 -42
  106. package/dist/module/src/components/pure/SingleProcessView.js +214 -0
  107. package/dist/module/src/components/pure/TestPageView.js +425 -76
  108. package/dist/module/src/components/pure/TestPageView.test/implementation.js +90 -135
  109. package/dist/module/src/components/stateful/FeaturesReporter.js +1 -1
  110. package/dist/module/src/components/stateful/FileTree.js +33 -0
  111. package/dist/module/src/components/stateful/ProcessManagerPage.js +75 -0
  112. package/dist/module/src/components/stateful/ProjectPage.js +6 -5
  113. package/dist/module/src/components/stateful/ProjectsPage.js +32 -6
  114. package/dist/module/src/components/stateful/SettingsPage.js +35 -0
  115. package/dist/module/src/components/stateful/SingleProcessPage.js +110 -0
  116. package/dist/module/src/components/stateful/TestPage.js +104 -8
  117. package/dist/module/src/components/stateful/TextEditorPage.js +117 -0
  118. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +3 -4
  119. package/dist/module/src/lib/{abstractBase.js → BaseGiven.js} +14 -89
  120. package/dist/module/src/lib/BaseSuite.js +6 -3
  121. package/dist/module/src/lib/BaseSuite.test/mock.js +22 -31
  122. package/dist/module/src/lib/BaseSuite.test/test.js +33 -31
  123. package/dist/module/src/lib/BaseThen.js +60 -0
  124. package/dist/module/src/lib/BaseWhen.js +41 -0
  125. package/dist/module/src/lib/Tiposkripto.js +146 -0
  126. package/dist/module/src/lib/{core.test/MockCore.js → Tiposkripto.test/MockTiposkripto.js} +3 -6
  127. package/dist/module/src/lib/{core.test/core.test.adapter.js → Tiposkripto.test/Tiposkripto.adapter.js} +10 -8
  128. package/dist/module/src/lib/{classBuilder.test/classBuilder.test.implementation.js → Tiposkripto.test/Tiposkripto.implementation.js} +44 -58
  129. package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.js +6 -0
  130. package/dist/module/src/lib/{classBuilder.test/classBuilder.test.specification.js → Tiposkripto.test/Tiposkripto.specification.js} +12 -8
  131. package/dist/module/src/lib/abstractBase.test/MockGiven.js +9 -2
  132. package/dist/module/src/lib/abstractBase.test/MockThen.js +5 -2
  133. package/dist/module/src/lib/abstractBase.test/MockWhen.js +9 -2
  134. package/dist/module/src/lib/abstractBase.test/adapter.js +18 -6
  135. package/dist/module/src/lib/abstractBase.test/implementation.js +3 -3
  136. package/dist/module/src/lib/index.js +11 -14
  137. package/dist/module/src/lib/mocks.test.js +11 -5
  138. package/dist/module/src/lib/pmProxy.js +37 -14
  139. package/dist/module/src/lib/pmProxy.test/adapter.js +12 -2
  140. package/dist/module/src/lib/pmProxy.test/implementation.js +73 -43
  141. package/dist/module/src/lib/pmProxy.test/specification.js +3 -0
  142. package/dist/module/src/run.js +15 -4
  143. package/dist/module/src/utils/api.js +45 -34
  144. package/dist/module/src/utils/logFiles.js +45 -20
  145. package/dist/module/src/utils/makePrompt.js +5 -4
  146. package/dist/module/testeranto.config.js +19 -41
  147. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  148. package/dist/prebuild/App.css +54 -513
  149. package/dist/prebuild/App.js +5291 -1921
  150. package/dist/prebuild/ReportServer.mjs +104 -6
  151. package/dist/prebuild/build.mjs +8 -5
  152. package/dist/prebuild/run.mjs +414 -51
  153. package/dist/tsconfig.tsbuildinfo +1 -1
  154. package/dist/types/design-editor/DesignEditor.d.ts +18 -0
  155. package/dist/types/design-editor/server.d.ts +1 -0
  156. package/dist/types/{Node.d.ts → src/Node.d.ts} +2 -2
  157. package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +2 -0
  158. package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +2 -0
  159. package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +2 -0
  160. package/dist/types/{PM → src/PM}/index.d.ts +1 -1
  161. package/dist/types/{PM → src/PM}/main.d.ts +19 -0
  162. package/dist/types/{PM → src/PM}/pure.d.ts +7 -7
  163. package/dist/types/{Pure.d.ts → src/Pure.d.ts} +2 -2
  164. package/dist/types/src/Pure.test.d.ts +2 -0
  165. package/dist/types/src/ReportServer.test.ts/index.d.ts +2 -0
  166. package/dist/types/{Types.d.ts → src/Types.d.ts} +3 -1
  167. package/dist/types/{Web.d.ts → src/Web.d.ts} +2 -2
  168. package/dist/types/src/components/DesignEditorPage.d.ts +1 -0
  169. package/dist/types/{components → src/components}/pure/AppFrame.d.ts +3 -1
  170. package/dist/types/src/components/pure/AppFrame.test/index.d.ts +3 -0
  171. package/dist/types/src/components/pure/FeaturesReporterView.test/index.d.ts +2 -0
  172. package/dist/types/src/components/pure/ModalContent.test/index.d.ts +2 -0
  173. package/dist/types/{components → src/components}/pure/NavBar.d.ts +4 -0
  174. package/dist/types/src/components/pure/ProcessManager.d.ts +8 -0
  175. package/dist/types/src/components/pure/ProcessManagerView.d.ts +20 -0
  176. package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +2 -0
  177. package/dist/types/{components → src/components}/pure/ProjectsPageView.d.ts +1 -1
  178. package/dist/types/src/components/pure/SettingsButton.d.ts +2 -0
  179. package/dist/types/{components → src/components}/pure/TestPageView.test/implementation.d.ts +3 -2
  180. package/dist/types/src/components/pure/TestPageView.test/index.d.ts +3 -0
  181. package/dist/types/src/components/stateful/FileTree.d.ts +8 -0
  182. package/dist/types/src/components/stateful/ProcessManagerPage.d.ts +2 -0
  183. package/dist/types/src/components/stateful/SettingsPage.d.ts +2 -0
  184. package/dist/types/src/components/stateful/SingleProcessPage.d.ts +2 -0
  185. package/dist/types/src/components/stateful/TextEditorPage.d.ts +1 -0
  186. package/dist/types/src/lib/BaseGiven.d.ts +44 -0
  187. package/dist/types/{lib → src/lib}/BaseSuite.d.ts +12 -7
  188. package/dist/types/{lib → src/lib}/BaseSuite.test/mock.d.ts +6 -4
  189. package/dist/types/src/lib/BaseSuite.test/node.test.d.ts +2 -0
  190. package/dist/types/src/lib/BaseSuite.test/pure.test.d.ts +2 -0
  191. package/dist/types/src/lib/BaseSuite.test/web.test.d.ts +2 -0
  192. package/dist/types/src/lib/BaseThen.d.ts +27 -0
  193. package/dist/types/src/lib/BaseWhen.d.ts +27 -0
  194. package/dist/types/src/lib/Tiposkripto.d.ts +35 -0
  195. package/dist/types/{lib/core.test/MockCore.d.ts → src/lib/Tiposkripto.test/MockTiposkripto.d.ts} +3 -3
  196. package/dist/types/{lib/core.test/core.test.adapter.d.ts → src/lib/Tiposkripto.test/Tiposkripto.adapter.d.ts} +1 -1
  197. package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.d.ts +2 -0
  198. package/dist/types/{lib/core.test/core.test.implementation.d.ts → src/lib/Tiposkripto.test/Tiposkripto.implementation.d.ts} +1 -1
  199. package/dist/types/{lib/core.test/core.test.specification.d.ts → src/lib/Tiposkripto.test/Tiposkripto.specification.d.ts} +1 -1
  200. package/dist/types/{lib/classBuilder.test/classBuilder.test.types.d.ts → src/lib/Tiposkripto.test/Tiposkripto.types.d.ts} +11 -9
  201. package/dist/types/{lib → src/lib}/abstractBase.test/MockGiven.d.ts +3 -1
  202. package/dist/types/{lib → src/lib}/abstractBase.test/MockThen.d.ts +1 -1
  203. package/dist/types/{lib → src/lib}/abstractBase.test/MockWhen.d.ts +1 -1
  204. package/dist/types/src/lib/abstractBase.test/index.d.ts +2 -0
  205. package/dist/types/{lib → src/lib}/abstractBase.test/types.d.ts +3 -3
  206. package/dist/types/{lib → src/lib}/index.d.ts +2 -2
  207. package/dist/types/{lib → src/lib}/pmProxy.test/index.d.ts +1 -2
  208. package/dist/types/{lib → src/lib}/pmProxy.test/mockPMBase.d.ts +1 -1
  209. package/dist/types/{lib → src/lib}/types.d.ts +3 -1
  210. package/dist/types/src/mothership/test.d.ts +2 -0
  211. package/dist/types/src/utils/logFiles.d.ts +71 -0
  212. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  213. package/docs/test-page-components.md +91 -0
  214. package/package.json +29 -10
  215. package/src/App.tsx +38 -5
  216. package/src/Node.ts +3 -2
  217. package/src/PM/PM_WithEslintAndTsc.ts +9 -4
  218. package/src/PM/base.ts +1 -0
  219. package/src/PM/index.ts +1 -1
  220. package/src/PM/main.ts +425 -9
  221. package/src/PM/node.ts +5 -2
  222. package/src/PM/pure.ts +23 -61
  223. package/src/PM/web.ts +7 -3
  224. package/src/Pure.test.ts +63 -99
  225. package/src/Pure.ts +3 -2
  226. package/src/README.md +20 -1
  227. package/src/ReportServer.ts +10 -3
  228. package/src/Types.ts +5 -3
  229. package/src/Web.ts +2 -2
  230. package/src/app.scss +169 -0
  231. package/src/build.ts +5 -1
  232. package/src/components/DesignEditorPage.tsx +202 -0
  233. package/src/components/pure/AppFrame.tsx +121 -16
  234. package/src/components/pure/ModalContent.test/implementation.tsx +14 -12
  235. package/src/components/pure/ModalContent.test/index.tsx +58 -6
  236. package/src/components/pure/ModalContent.test/specification.ts +2 -2
  237. package/src/components/pure/NavBar.tsx +31 -15
  238. package/src/components/pure/ProcessManager.tsx +117 -0
  239. package/src/components/pure/ProcessManagerView.tsx +414 -0
  240. package/src/components/pure/ProjectPageView.test/implementation.tsx +136 -106
  241. package/src/components/pure/ProjectPageView.test/index.tsx +0 -2
  242. package/src/components/pure/ProjectsPageView.tsx +41 -31
  243. package/src/components/pure/SettingsButton.tsx +7 -62
  244. package/src/components/pure/SingleProcessView.tsx +235 -0
  245. package/src/components/pure/TestPageView.test/implementation.ts +115 -147
  246. package/src/components/pure/TestPageView.test/specification.ts +0 -1
  247. package/src/components/pure/TestPageView.tsx +821 -100
  248. package/src/components/stateful/FeaturesReporter.tsx +1 -1
  249. package/src/components/stateful/FileTree.tsx +66 -0
  250. package/src/components/stateful/ProcessManagerPage.tsx +108 -0
  251. package/src/components/stateful/ProjectPage.tsx +6 -5
  252. package/src/components/stateful/ProjectsPage.tsx +36 -7
  253. package/src/components/stateful/SettingsPage.tsx +82 -0
  254. package/src/components/stateful/SingleProcessPage.tsx +155 -0
  255. package/src/components/stateful/TestPage.tsx +128 -20
  256. package/src/components/stateful/TextEditorPage.tsx +170 -0
  257. package/src/esbuildConfigs/inputFilesPlugin.ts +3 -4
  258. package/src/lib/BaseGiven.ts +193 -0
  259. package/src/lib/BaseSuite.test/mock.ts +28 -42
  260. package/src/lib/BaseSuite.test/test.ts +38 -42
  261. package/src/lib/BaseSuite.ts +20 -4
  262. package/src/lib/BaseThen.ts +108 -0
  263. package/src/lib/BaseWhen.ts +91 -0
  264. package/src/lib/{core.test/MockCore.ts → Tiposkripto.test/MockTiposkripto.ts} +4 -7
  265. package/src/lib/{core.test/core.test.adapter.ts → Tiposkripto.test/Tiposkripto.adapter.ts} +12 -11
  266. package/src/lib/{classBuilder.test/classBuilder.test.implementation.ts → Tiposkripto.test/Tiposkripto.implementation.ts} +75 -78
  267. package/src/lib/Tiposkripto.test/Tiposkripto.specification.ts +109 -0
  268. package/src/lib/Tiposkripto.test/Tiposkripto.ts +15 -0
  269. package/src/lib/{classBuilder.test/classBuilder.test.types.ts → Tiposkripto.test/Tiposkripto.types.ts} +12 -9
  270. package/src/lib/Tiposkripto.ts +325 -0
  271. package/src/lib/abstractBase.test/MockGiven.ts +12 -2
  272. package/src/lib/abstractBase.test/MockThen.ts +7 -2
  273. package/src/lib/abstractBase.test/MockWhen.ts +10 -2
  274. package/src/lib/abstractBase.test/adapter.ts +20 -6
  275. package/src/lib/abstractBase.test/implementation.ts +6 -6
  276. package/src/lib/abstractBase.test/types.ts +3 -3
  277. package/src/lib/index.ts +26 -20
  278. package/src/lib/mocks.test.ts +10 -9
  279. package/src/lib/pmProxy.test/adapter.ts +10 -2
  280. package/src/lib/pmProxy.test/implementation.ts +108 -57
  281. package/src/lib/pmProxy.test/mockPMBase.ts +1 -1
  282. package/src/lib/pmProxy.test/specification.ts +11 -0
  283. package/src/lib/pmProxy.ts +40 -15
  284. package/src/lib/types.ts +3 -1
  285. package/src/run.ts +19 -4
  286. package/src/style.scss +3 -502
  287. package/src/templates/frontpage.html +317 -40
  288. package/src/templates/frontpage.md +79 -0
  289. package/src/themes.scss +40 -8
  290. package/src/utils/api.ts +47 -44
  291. package/src/utils/logFiles.ts +57 -23
  292. package/src/utils/makePrompt.ts +5 -4
  293. package/stargazers.txt +15 -0
  294. package/stargzers.js +68 -0
  295. package/testeranto/App.css +54 -513
  296. package/testeranto/App.js +5291 -1921
  297. package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +1146 -46
  298. package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +1016 -72
  299. package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.mjs +1004 -86
  300. package/testeranto/metafiles/node/core.json +990 -0
  301. package/testeranto/{bundles/pure/core/metafile.json → metafiles/pure/core.json} +153 -309
  302. package/testeranto/{bundles/web/core/metafile.json → metafiles/web/core.json} +1075 -1825
  303. package/testeranto/reports/core/config.json +8 -64
  304. package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +1 -1
  305. package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +63 -103
  306. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +61 -50
  307. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/prompt.txt +1 -1
  308. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +24 -32
  309. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/type_errors.txt +17 -41
  310. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +22 -33
  311. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +0 -2
  312. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +13 -2
  313. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +1 -1
  314. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +30 -41
  315. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +31 -77
  316. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/lint_errors.txt +47 -0
  317. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/prompt.txt +2 -3
  318. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/tests.json +17 -29
  319. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/type_errors.txt +84 -96
  320. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +3 -2
  321. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +7 -9
  322. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +42 -99
  323. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +1 -1
  324. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +42 -99
  325. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +1 -1
  326. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/tests.json +7 -9
  327. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/type_errors.txt +41 -98
  328. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +1 -0
  329. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +17 -0
  330. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +18 -0
  331. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +32 -0
  332. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +1 -1
  333. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +6 -14
  334. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +3 -3
  335. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +66 -0
  336. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +10 -0
  337. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +21 -52
  338. package/testeranto/reports/core/summary.json +22 -71
  339. package/testeranto.config.ts +21 -45
  340. package/tsc.log +289 -449
  341. package/tsconfig.json +3 -2
  342. package/CNAME +0 -1
  343. package/README.html +0 -302
  344. package/dist/common/src/PM/layers/base/PM_Base.js +0 -1
  345. package/dist/common/src/PM/layers/base/components/PageOperations.js +0 -1
  346. package/dist/common/src/PM/layers/base/components/PageOperations.testeranto.js +0 -1
  347. package/dist/common/src/PM/layers/linting/components/Linter.js +0 -1
  348. package/dist/common/src/PM/layers/linting/components/TypeChecker.js +0 -1
  349. package/dist/common/src/PM/layers/main/components/SidecarManager.js +0 -1
  350. package/dist/common/src/PM/layers/main/components/TestRunner.js +0 -1
  351. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +0 -19
  352. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +0 -113
  353. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +0 -46
  354. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.node.js +0 -12
  355. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.pure.js +0 -12
  356. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +0 -18
  357. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.web.js +0 -12
  358. package/dist/common/src/lib/basebuilder.js +0 -96
  359. package/dist/common/src/lib/classBuilder.js +0 -36
  360. package/dist/common/src/lib/classBuilder.test/classBuilder.test.adapter.js +0 -23
  361. package/dist/common/src/lib/classBuilder.test/classBuilder.test.js +0 -12
  362. package/dist/common/src/lib/classBuilder.test/mock.js +0 -17
  363. package/dist/common/src/lib/core.js +0 -47
  364. package/dist/common/src/lib/core.test/core.test.implementation.js +0 -121
  365. package/dist/common/src/lib/core.test/core.test.js +0 -63
  366. package/dist/common/src/lib/core.test/core.test.specification.js +0 -53
  367. package/dist/common/src/lib/core.test/core.test.types.js +0 -2
  368. package/dist/module/src/PM/layers/base/PM_Base.js +0 -1
  369. package/dist/module/src/PM/layers/base/components/PageOperations.js +0 -1
  370. package/dist/module/src/PM/layers/base/components/PageOperations.testeranto.js +0 -1
  371. package/dist/module/src/PM/layers/linting/components/Linter.js +0 -1
  372. package/dist/module/src/PM/layers/linting/components/TypeChecker.js +0 -1
  373. package/dist/module/src/PM/layers/main/components/SidecarManager.js +0 -1
  374. package/dist/module/src/PM/layers/main/components/TestRunner.js +0 -1
  375. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +0 -16
  376. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +0 -110
  377. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +0 -42
  378. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.node.js +0 -7
  379. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.pure.js +0 -7
  380. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +0 -14
  381. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.web.js +0 -7
  382. package/dist/module/src/lib/basebuilder.js +0 -92
  383. package/dist/module/src/lib/classBuilder.js +0 -32
  384. package/dist/module/src/lib/classBuilder.test/classBuilder.test.adapter.js +0 -20
  385. package/dist/module/src/lib/classBuilder.test/classBuilder.test.js +0 -7
  386. package/dist/module/src/lib/classBuilder.test/mock.js +0 -14
  387. package/dist/module/src/lib/core.js +0 -44
  388. package/dist/module/src/lib/core.test/core.test.implementation.js +0 -118
  389. package/dist/module/src/lib/core.test/core.test.js +0 -58
  390. package/dist/module/src/lib/core.test/core.test.specification.js +0 -49
  391. package/dist/module/src/lib/core.test/core.test.types.js +0 -1
  392. package/dist/types/PM/__tests__/nodeSidecar.testeranto.d.ts +0 -16
  393. package/dist/types/PM/__tests__/pureSidecar.testeranto.d.ts +0 -16
  394. package/dist/types/PM/__tests__/webSidecar.testeranto.d.ts +0 -16
  395. package/dist/types/PM/layers/base/components/PageOperations.testeranto.d.ts +0 -0
  396. package/dist/types/PM/layers/linting/components/Linter.d.ts +0 -0
  397. package/dist/types/PM/layers/linting/components/TypeChecker.d.ts +0 -0
  398. package/dist/types/PM/layers/main/components/SidecarManager.d.ts +0 -0
  399. package/dist/types/PM/layers/main/components/TestRunner.d.ts +0 -0
  400. package/dist/types/Pure.test.d.ts +0 -47
  401. package/dist/types/ReportServer.test.ts/index.d.ts +0 -29
  402. package/dist/types/components/pure/AppFrame.test/index.d.ts +0 -5
  403. package/dist/types/components/pure/FeaturesReporterView.test/index.d.ts +0 -2
  404. package/dist/types/components/pure/ModalContent.test/index.d.ts +0 -2
  405. package/dist/types/components/pure/ProjectPageView.test/index.d.ts +0 -2
  406. package/dist/types/components/pure/SettingsButton.d.ts +0 -3
  407. package/dist/types/components/pure/TestPageView.test/index.d.ts +0 -32
  408. package/dist/types/lib/BaseSuite.test/node.test.d.ts +0 -3
  409. package/dist/types/lib/BaseSuite.test/pure.test.d.ts +0 -3
  410. package/dist/types/lib/BaseSuite.test/web.test.d.ts +0 -3
  411. package/dist/types/lib/abstractBase.d.ts +0 -70
  412. package/dist/types/lib/abstractBase.test/index.d.ts +0 -3
  413. package/dist/types/lib/baseBuilder.test/baseBuilder.test.adapter.d.ts +0 -3
  414. package/dist/types/lib/baseBuilder.test/baseBuilder.test.implementation.d.ts +0 -3
  415. package/dist/types/lib/baseBuilder.test/baseBuilder.test.mock.d.ts +0 -15
  416. package/dist/types/lib/baseBuilder.test/baseBuilder.test.node.d.ts +0 -3
  417. package/dist/types/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +0 -3
  418. package/dist/types/lib/baseBuilder.test/baseBuilder.test.specification.d.ts +0 -3
  419. package/dist/types/lib/baseBuilder.test/baseBuilder.test.types.d.ts +0 -22
  420. package/dist/types/lib/baseBuilder.test/baseBuilder.test.web.d.ts +0 -3
  421. package/dist/types/lib/basebuilder.d.ts +0 -23
  422. package/dist/types/lib/classBuilder.d.ts +0 -15
  423. package/dist/types/lib/classBuilder.test/classBuilder.test.adapter.d.ts +0 -3
  424. package/dist/types/lib/classBuilder.test/classBuilder.test.d.ts +0 -3
  425. package/dist/types/lib/classBuilder.test/classBuilder.test.implementation.d.ts +0 -3
  426. package/dist/types/lib/classBuilder.test/classBuilder.test.specification.d.ts +0 -3
  427. package/dist/types/lib/classBuilder.test/mock.d.ts +0 -14
  428. package/dist/types/lib/core.d.ts +0 -12
  429. package/dist/types/lib/core.test/core.test.d.ts +0 -3
  430. package/dist/types/lib/core.test/core.test.types.d.ts +0 -46
  431. package/dist/types/lib/mocks.test.d.ts +0 -2
  432. package/dist/types/mothership/test.d.ts +0 -19
  433. package/dist/types/utils/logFiles.d.ts +0 -7
  434. package/docs.html +0 -590
  435. package/example.css +0 -351
  436. package/index.html +0 -138
  437. package/scripts/compile-docs.js +0 -150
  438. package/smil30/SMIL-anim.mod.xsd +0 -163
  439. package/smil30/SMIL-control.mod.xsd +0 -73
  440. package/smil30/SMIL-layout.mod.xsd +0 -149
  441. package/smil30/SMIL-link.mod.xsd +0 -145
  442. package/smil30/SMIL-media.mod.xsd +0 -1646
  443. package/smil30/SMIL-metainformation.mod.xsd +0 -45
  444. package/smil30/SMIL-smiltext.mod.xsd +0 -353
  445. package/smil30/SMIL-state.mod.xsd +0 -133
  446. package/smil30/SMIL-struct.mod.xsd +0 -70
  447. package/smil30/SMIL-timing.mod.xsd +0 -105
  448. package/smil30/SMIL-transition.mod.xsd +0 -229
  449. package/smil30/SMIL.xsd +0 -63
  450. package/smil30/its.xsd +0 -42
  451. package/smil30/smil-attribs-1.mod.xsd +0 -610
  452. package/smil30/smil-datatypes-1.mod.xsd +0 -72
  453. package/smil30/smil-framework-1.mod.xsd +0 -45
  454. package/smil30/xml.xsd +0 -16
  455. package/src/App.scss +0 -123
  456. package/src/PM/layers/base/PM_Base.ts +0 -0
  457. package/src/PM/layers/base/components/PageOperations.testeranto.ts +0 -0
  458. package/src/PM/layers/base/components/PageOperations.ts +0 -0
  459. package/src/PM/layers/linting/components/Linter.ts +0 -0
  460. package/src/PM/layers/linting/components/TypeChecker.ts +0 -0
  461. package/src/PM/layers/main/components/SidecarManager.ts +0 -0
  462. package/src/PM/layers/main/components/TestRunner.ts +0 -0
  463. package/src/fonts.scss +0 -55
  464. package/src/lib/abstractBase.ts +0 -332
  465. package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +0 -22
  466. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +0 -138
  467. package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +0 -90
  468. package/src/lib/baseBuilder.test/baseBuilder.test.node.ts +0 -16
  469. package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +0 -16
  470. package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +0 -35
  471. package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +0 -36
  472. package/src/lib/baseBuilder.test/baseBuilder.test.web.ts +0 -16
  473. package/src/lib/basebuilder.ts +0 -192
  474. package/src/lib/classBuilder.test/classBuilder.test.adapter.ts +0 -25
  475. package/src/lib/classBuilder.test/classBuilder.test.specification.ts +0 -104
  476. package/src/lib/classBuilder.test/classBuilder.test.ts +0 -14
  477. package/src/lib/classBuilder.test/mock.ts +0 -83
  478. package/src/lib/classBuilder.ts +0 -122
  479. package/src/lib/core.test/core.test.implementation.ts +0 -155
  480. package/src/lib/core.test/core.test.specification.ts +0 -113
  481. package/src/lib/core.test/core.test.ts +0 -72
  482. package/src/lib/core.test/core.test.types.ts +0 -68
  483. package/src/lib/core.ts +0 -141
  484. package/style.css +0 -12175
  485. package/testeranto/bundles/node/core/chunk-JBB5E3XJ.mjs +0 -258
  486. package/testeranto/bundles/node/core/chunk-L67RWZ4W.mjs +0 -899
  487. package/testeranto/bundles/node/core/chunk-ZQRRQYS4.mjs +0 -92
  488. package/testeranto/bundles/node/core/metafile.json +0 -5735
  489. package/testeranto/bundles/node/core/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -247
  490. package/testeranto/bundles/node/core/src/lib/classBuilder.test/classBuilder.test.mjs +0 -423
  491. package/testeranto/bundles/node/core/src/lib/core.test/core.test.mjs +0 -505
  492. package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +0 -4804
  493. package/testeranto/bundles/node/core/src/mothership/test.mjs +0 -24588
  494. package/testeranto/bundles/pure/core/chunk-KHJ35R7C.mjs +0 -997
  495. package/testeranto/bundles/pure/core/src/Pure.test.mjs +0 -428
  496. package/testeranto/bundles/pure/core/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -235
  497. package/testeranto/bundles/web/core/MPLUSRounded1c-Black-O75GP5JI.ttf +0 -0
  498. package/testeranto/bundles/web/core/MPLUSRounded1c-Bold-R524Q5BH.ttf +0 -0
  499. package/testeranto/bundles/web/core/MPLUSRounded1c-ExtraBold-C6GRMYVT.ttf +0 -0
  500. package/testeranto/bundles/web/core/MPLUSRounded1c-Light-WKN65Y2C.ttf +0 -0
  501. package/testeranto/bundles/web/core/MPLUSRounded1c-Medium-ZC4DWL7C.ttf +0 -0
  502. package/testeranto/bundles/web/core/MPLUSRounded1c-Regular-DT6EKZ3S.ttf +0 -0
  503. package/testeranto/bundles/web/core/MPLUSRounded1c-Thin-YWDNVG6M.ttf +0 -0
  504. package/testeranto/bundles/web/core/chunk-BADF3AZF.mjs +0 -108
  505. package/testeranto/bundles/web/core/chunk-BXV27S2S.mjs +0 -6252
  506. package/testeranto/bundles/web/core/chunk-EIYZKF2C.mjs +0 -223
  507. package/testeranto/bundles/web/core/chunk-FNXFUNA7.mjs +0 -28528
  508. package/testeranto/bundles/web/core/chunk-LU364HVS.mjs +0 -3311
  509. package/testeranto/bundles/web/core/chunk-QWII7WIM.mjs +0 -2281
  510. package/testeranto/bundles/web/core/chunk-VAYOSMXI.mjs +0 -21775
  511. package/testeranto/bundles/web/core/src/components/pure/AppFrame.test/index.css +0 -12105
  512. package/testeranto/bundles/web/core/src/components/pure/AppFrame.test/index.html +0 -15
  513. package/testeranto/bundles/web/core/src/components/pure/AppFrame.test/index.mjs +0 -517
  514. package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.html +0 -15
  515. package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.mjs +0 -166
  516. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.css +0 -12105
  517. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.html +0 -15
  518. package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.mjs +0 -93
  519. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.css +0 -12105
  520. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.html +0 -15
  521. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +0 -343
  522. package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.css +0 -12105
  523. package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.html +0 -15
  524. package/testeranto/bundles/web/core/src/components/pure/TestPageView.test/index.mjs +0 -483
  525. package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.html +0 -15
  526. package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -256
  527. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/debug.log +0 -0
  528. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/error.log +0 -22
  529. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/exit.log +0 -1
  530. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/info.log +0 -4
  531. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/lint_errors.txt +0 -2
  532. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/prompt.txt +0 -18
  533. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/tests.json +0 -57
  534. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/type_errors.txt +0 -55
  535. package/testeranto/reports/core/src/components/pure/AppFrame.test/index/web/warn.log +0 -0
  536. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/suite-0/given-basicRender/then-4/butThen/features-reporter.png +0 -0
  537. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/debug.log +0 -0
  538. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/error.log +0 -0
  539. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/exit.log +0 -0
  540. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/info.log +0 -4
  541. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/message.txt +0 -17
  542. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/prompt.txt +0 -15
  543. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/suite-0/given-basicRender/then-2/butThen/modal-content.png +0 -0
  544. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/tests.json +0 -42
  545. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/type_errors.txt +0 -65
  546. package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/warn.log +0 -0
  547. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-6/butThen/happy-state.png +0 -0
  548. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-errorHandling/then-1/butThen/error-state.png +0 -0
  549. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/exit.log +0 -1
  550. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -0
  551. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -17
  552. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -17
  553. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/stderr.log +0 -0
  554. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/stdout.log +0 -2
  555. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +0 -1
  556. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-1/butThen/artifact_test.txt +0 -1
  557. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -71
  558. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -65
  559. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/exit.log +0 -0
  560. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -0
  561. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -17
  562. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -17
  563. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -65
  564. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/debug.log +0 -0
  565. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/error.log +0 -1
  566. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/exit.log +0 -1
  567. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/info.log +0 -0
  568. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -0
  569. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -17
  570. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -17
  571. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-0/butThen/hello.txt +0 -1
  572. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-1/butThen/artifact_test.txt +0 -1
  573. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -71
  574. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -65
  575. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/warn.log +0 -0
  576. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/exit.log +0 -1
  577. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
  578. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/message.txt +0 -17
  579. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +0 -17
  580. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/stderr.log +0 -0
  581. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/stdout.log +0 -619
  582. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/tests.json +0 -165
  583. package/testeranto/reports/core/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +0 -140
  584. package/testeranto/reports/core/src/lib/core.test/core.test/node/exit.log +0 -1
  585. package/testeranto/reports/core/src/lib/core.test/core.test/node/lint_errors.txt +0 -21
  586. package/testeranto/reports/core/src/lib/core.test/core.test/node/message.txt +0 -17
  587. package/testeranto/reports/core/src/lib/core.test/core.test/node/prompt.txt +0 -19
  588. package/testeranto/reports/core/src/lib/core.test/core.test/node/stderr.log +0 -0
  589. package/testeranto/reports/core/src/lib/core.test/core.test/node/type_errors.txt +0 -64
  590. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/tests.json +0 -162
  591. package/testeranto/reports/core/src/mothership/test/node/exit.log +0 -1
  592. package/testeranto/reports/core/src/mothership/test/node/lint_errors.txt +0 -0
  593. package/testeranto/reports/core/src/mothership/test/node/message.txt +0 -17
  594. package/testeranto/reports/core/src/mothership/test/node/prompt.txt +0 -14
  595. package/testeranto/reports/core/src/mothership/test/node/stderr.log +0 -27
  596. package/testeranto/reports/core/src/mothership/test/node/stdout.log +0 -8
  597. package/testeranto/reports/core/src/mothership/test/node/tests.json +0 -36
  598. package/testeranto/reports/core/src/mothership/test/node/type_errors.txt +0 -38
  599. package/videos/download-smil-xsd.sh +0 -29
  600. package/videos/project0/index.md +0 -72
  601. package/videos/project0/narration.json +0 -7
  602. package/videos/project0/narration.ssml +0 -58
  603. package/videos/project0/package.json +0 -21
  604. package/videos/project0/presentation.smil +0 -25
  605. package/videos/project0/smil30/SMIL-anim.mod.xsd +0 -163
  606. package/videos/project0/smil30/SMIL-anim.mod.xsd.1 +0 -163
  607. package/videos/project0/smil30/SMIL-anim.mod.xsd.2 +0 -163
  608. package/videos/project0/smil30/SMIL-control.mod.xsd +0 -73
  609. package/videos/project0/smil30/SMIL-control.mod.xsd.1 +0 -73
  610. package/videos/project0/smil30/SMIL-control.mod.xsd.2 +0 -73
  611. package/videos/project0/smil30/SMIL-layout.mod.xsd +0 -149
  612. package/videos/project0/smil30/SMIL-layout.mod.xsd.1 +0 -149
  613. package/videos/project0/smil30/SMIL-layout.mod.xsd.2 +0 -149
  614. package/videos/project0/smil30/SMIL-link.mod.xsd +0 -145
  615. package/videos/project0/smil30/SMIL-link.mod.xsd.1 +0 -145
  616. package/videos/project0/smil30/SMIL-link.mod.xsd.2 +0 -145
  617. package/videos/project0/smil30/SMIL-media.mod.xsd +0 -1646
  618. package/videos/project0/smil30/SMIL-media.mod.xsd.1 +0 -1646
  619. package/videos/project0/smil30/SMIL-media.mod.xsd.2 +0 -1646
  620. package/videos/project0/smil30/SMIL-metainformation.mod.xsd +0 -45
  621. package/videos/project0/smil30/SMIL-metainformation.mod.xsd.1 +0 -45
  622. package/videos/project0/smil30/SMIL-metainformation.mod.xsd.2 +0 -45
  623. package/videos/project0/smil30/SMIL-smiltext.mod.xsd +0 -353
  624. package/videos/project0/smil30/SMIL-smiltext.mod.xsd.1 +0 -353
  625. package/videos/project0/smil30/SMIL-smiltext.mod.xsd.2 +0 -353
  626. package/videos/project0/smil30/SMIL-state.mod.xsd +0 -133
  627. package/videos/project0/smil30/SMIL-state.mod.xsd.1 +0 -133
  628. package/videos/project0/smil30/SMIL-state.mod.xsd.2 +0 -133
  629. package/videos/project0/smil30/SMIL-struct.mod.xsd +0 -70
  630. package/videos/project0/smil30/SMIL-struct.mod.xsd.1 +0 -70
  631. package/videos/project0/smil30/SMIL-struct.mod.xsd.2 +0 -70
  632. package/videos/project0/smil30/SMIL-timing.mod.xsd +0 -105
  633. package/videos/project0/smil30/SMIL-timing.mod.xsd.1 +0 -105
  634. package/videos/project0/smil30/SMIL-timing.mod.xsd.2 +0 -105
  635. package/videos/project0/smil30/SMIL-transition.mod.xsd +0 -229
  636. package/videos/project0/smil30/SMIL-transition.mod.xsd.1 +0 -229
  637. package/videos/project0/smil30/SMIL-transition.mod.xsd.2 +0 -229
  638. package/videos/project0/smil30/SMIL.xsd +0 -63
  639. package/videos/project0/smil30/SMIL.xsd.1 +0 -63
  640. package/videos/project0/smil30/SMIL.xsd.2 +0 -63
  641. package/videos/project0/smil30/its.xsd +0 -42
  642. package/videos/project0/smil30/its.xsd.1 +0 -42
  643. package/videos/project0/smil30/its.xsd.2 +0 -42
  644. package/videos/project0/smil30/smil-attribs-1.mod.xsd +0 -610
  645. package/videos/project0/smil30/smil-attribs-1.mod.xsd.1 +0 -610
  646. package/videos/project0/smil30/smil-attribs-1.mod.xsd.2 +0 -610
  647. package/videos/project0/smil30/smil-datatypes-1.mod.xsd +0 -72
  648. package/videos/project0/smil30/smil-datatypes-1.mod.xsd.1 +0 -72
  649. package/videos/project0/smil30/smil-datatypes-1.mod.xsd.2 +0 -72
  650. package/videos/project0/smil30/smil-framework-1.mod.xsd +0 -45
  651. package/videos/project0/smil30/smil-framework-1.mod.xsd.1 +0 -45
  652. package/videos/project0/smil30/smil-framework-1.mod.xsd.2 +0 -45
  653. package/videos/project0/smil30/smil-profile-model-1.mod.xsd +0 -1331
  654. package/videos/project0/smil30/smil-profile-model-1.mod.xsd.1 +0 -1331
  655. package/videos/project0/smil30/smil-qname-1.mod.xsd +0 -121
  656. package/videos/project0/smil30/smil-qname-1.mod.xsd.1 +0 -121
  657. package/videos/project0/smil30/xml.xsd +0 -16
  658. package/videos/project0/smil30/xml.xsd.1 +0 -16
  659. package/videos/project0/smil30/xml.xsd.2 +0 -16
  660. package/videos/project0/smil30.xsd +0 -137
  661. package/videos/project0/src/audio/metadata.json +0 -5
  662. package/videos/project0/src/audio/narration.mp3 +0 -0
  663. package/videos/project0/src/motion-canvas.d.ts +0 -1
  664. package/videos/project0/src/project.meta +0 -31
  665. package/videos/project0/src/project.ts +0 -13
  666. package/videos/project0/src/scenes/example.meta +0 -5
  667. package/videos/project0/src/scenes/scene1.meta +0 -3
  668. package/videos/project0/src/scenes/scene1.tsx +0 -129
  669. package/videos/project0/src/scenes/scene2.tsx +0 -132
  670. package/videos/project0/src/scenes/scene3.meta +0 -26
  671. package/videos/project0/src/scenes/scene3.tsx +0 -188
  672. package/videos/project0/tsconfig.json +0 -4
  673. package/videos/project0/vite.config.ts +0 -10
  674. package/videos/trash/output/project.mp4 +0 -0
  675. package/videos/trash/text.mp4 +0 -0
  676. package/videos/trash/video/project.tsx +0 -549
  677. package/videos/trash/video/render.ts +0 -15
  678. package/videos/trash/vite.config.ts +0 -10
  679. package/videos/tts.js +0 -109
  680. /package/dist/common/{src/lib/baseBuilder.test/baseBuilder.test.types.js → design-editor/types.js} +0 -0
  681. /package/dist/common/src/lib/{classBuilder.test/classBuilder.test.types.js → Tiposkripto.test/Tiposkripto.types.js} +0 -0
  682. /package/dist/module/{src/lib/baseBuilder.test/baseBuilder.test.types.js → design-editor/types.js} +0 -0
  683. /package/dist/module/src/lib/{classBuilder.test/classBuilder.test.types.js → Tiposkripto.test/Tiposkripto.types.js} +0 -0
  684. /package/dist/types/{App.d.ts → src/App.d.ts} +0 -0
  685. /package/dist/types/{CoreTypes.d.ts → src/CoreTypes.d.ts} +0 -0
  686. /package/dist/types/{Init.d.ts → src/Init.d.ts} +0 -0
  687. /package/dist/types/{NodeSidecar.d.ts → src/NodeSidecar.d.ts} +0 -0
  688. /package/dist/types/{PM → src/PM}/PM_WithEslintAndTsc.d.ts +0 -0
  689. /package/dist/types/{PM → src/PM}/base.d.ts +0 -0
  690. /package/dist/types/{PM → src/PM}/node.d.ts +0 -0
  691. /package/dist/types/{PM → src/PM}/nodeSidecar.d.ts +0 -0
  692. /package/dist/types/{PM → src/PM}/pureSidecar.d.ts +0 -0
  693. /package/dist/types/{PM → src/PM}/sidecar.d.ts +0 -0
  694. /package/dist/types/{PM → src/PM}/types.d.ts +0 -0
  695. /package/dist/types/{PM → src/PM}/web.d.ts +0 -0
  696. /package/dist/types/{PM → src/PM}/webSidecar.d.ts +0 -0
  697. /package/dist/types/{PureSidecar.d.ts → src/PureSidecar.d.ts} +0 -0
  698. /package/dist/types/{ReportServer.d.ts → src/ReportServer.d.ts} +0 -0
  699. /package/dist/types/{ReportServerLib.d.ts → src/ReportServerLib.d.ts} +0 -0
  700. /package/dist/types/{WebSidecar.d.ts → src/WebSidecar.d.ts} +0 -0
  701. /package/dist/types/{build.d.ts → src/build.d.ts} +0 -0
  702. /package/dist/types/{components → src/components}/SunriseAnimation.d.ts +0 -0
  703. /package/dist/types/{components → src/components}/SunriseAnimation.test/implementation.d.ts +0 -0
  704. /package/dist/types/{components → src/components}/SunriseAnimation.test/index.d.ts +0 -0
  705. /package/dist/types/{components → src/components}/SunriseAnimation.test/interface.d.ts +0 -0
  706. /package/dist/types/{components → src/components}/SunriseAnimation.test/specification.d.ts +0 -0
  707. /package/dist/types/{components → src/components}/SunriseAnimation.test/types.d.ts +0 -0
  708. /package/dist/types/{components → src/components}/TestStatusBadge.d.ts +0 -0
  709. /package/dist/types/{components → src/components}/pure/AppFrame.test/implementation.d.ts +0 -0
  710. /package/dist/types/{components → src/components}/pure/AppFrame.test/specification.d.ts +0 -0
  711. /package/dist/types/{components → src/components}/pure/AppFrame.test/types.d.ts +0 -0
  712. /package/dist/types/{components → src/components}/pure/FeaturesReporterView.d.ts +0 -0
  713. /package/dist/types/{components → src/components}/pure/FeaturesReporterView.test/implementation.d.ts +0 -0
  714. /package/dist/types/{components → src/components}/pure/FeaturesReporterView.test/specification.d.ts +0 -0
  715. /package/dist/types/{components → src/components}/pure/FeaturesReporterView.test/types.d.ts +0 -0
  716. /package/dist/types/{components → src/components}/pure/ModalContent.d.ts +0 -0
  717. /package/dist/types/{components → src/components}/pure/ModalContent.test/implementation.d.ts +0 -0
  718. /package/dist/types/{components → src/components}/pure/ModalContent.test/specification.d.ts +0 -0
  719. /package/dist/types/{components → src/components}/pure/ModalContent.test/types.d.ts +0 -0
  720. /package/dist/types/{components → src/components}/pure/ProjectPageView.d.ts +0 -0
  721. /package/dist/types/{components → src/components}/pure/ProjectPageView.test/implementation.d.ts +0 -0
  722. /package/dist/types/{components → src/components}/pure/ProjectPageView.test/specification.d.ts +0 -0
  723. /package/dist/types/{components → src/components}/pure/ProjectPageView.test/types.d.ts +0 -0
  724. /package/dist/types/{PM/layers/base/PM_Base.d.ts → src/components/pure/SingleProcessView.d.ts} +0 -0
  725. /package/dist/types/{components → src/components}/pure/TestPageView.d.ts +0 -0
  726. /package/dist/types/{components → src/components}/pure/TestPageView.test/specification.d.ts +0 -0
  727. /package/dist/types/{components → src/components}/pure/TestPageView.test/types.d.ts +0 -0
  728. /package/dist/types/{components → src/components}/pure/ThemeCard.d.ts +0 -0
  729. /package/dist/types/{components → src/components}/stateful/FeaturesReporter.d.ts +0 -0
  730. /package/dist/types/{components → src/components}/stateful/ProjectPage.d.ts +0 -0
  731. /package/dist/types/{components → src/components}/stateful/ProjectsPage.d.ts +0 -0
  732. /package/dist/types/{components → src/components}/stateful/TestPage.d.ts +0 -0
  733. /package/dist/types/{defaultConfig.d.ts → src/defaultConfig.d.ts} +0 -0
  734. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/consoleDetectorPlugin.d.ts +0 -0
  735. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/eslint-formatter-testeranto.d.ts +0 -0
  736. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/featuresPlugin.d.ts +0 -0
  737. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
  738. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
  739. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/nativeImportDetectorPlugin.d.ts +0 -0
  740. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
  741. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/pure.d.ts +0 -0
  742. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/rebuildPlugin.d.ts +0 -0
  743. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
  744. /package/dist/types/{init-docs.d.ts → src/init-docs.d.ts} +0 -0
  745. /package/dist/types/{lib → src/lib}/BaseSuite.test/test.d.ts +0 -0
  746. /package/dist/types/{lib → src/lib}/Sidecar.d.ts +0 -0
  747. /package/dist/types/{lib → src/lib}/abstractBase.test/adapter.d.ts +0 -0
  748. /package/dist/types/{lib → src/lib}/abstractBase.test/implementation.d.ts +0 -0
  749. /package/dist/types/{lib → src/lib}/abstractBase.test/specification.d.ts +0 -0
  750. /package/dist/types/{PM/layers/base/components/PageOperations.d.ts → src/lib/mocks.test.d.ts} +0 -0
  751. /package/dist/types/{lib → src/lib}/pmProxy.d.ts +0 -0
  752. /package/dist/types/{lib → src/lib}/pmProxy.test/adapter.d.ts +0 -0
  753. /package/dist/types/{lib → src/lib}/pmProxy.test/implementation.d.ts +0 -0
  754. /package/dist/types/{lib → src/lib}/pmProxy.test/mockPM.d.ts +0 -0
  755. /package/dist/types/{lib → src/lib}/pmProxy.test/specification.d.ts +0 -0
  756. /package/dist/types/{lib → src/lib}/pmProxy.test/types.d.ts +0 -0
  757. /package/dist/types/{mothership → src/mothership}/index.d.ts +0 -0
  758. /package/dist/types/{run.d.ts → src/run.d.ts} +0 -0
  759. /package/dist/types/{types → src/types}/features.d.ts +0 -0
  760. /package/dist/types/{utils → src/utils}/api.d.ts +0 -0
  761. /package/dist/types/{utils → src/utils}/buildTemplates.d.ts +0 -0
  762. /package/dist/types/{utils → src/utils}/featureUtils.d.ts +0 -0
  763. /package/dist/types/{utils → src/utils}/makePrompt.d.ts +0 -0
  764. /package/dist/types/{utils → src/utils}/queue.d.ts +0 -0
  765. /package/dist/types/{utils.d.ts → src/utils.d.ts} +0 -0
  766. /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
  767. /package/testeranto/reports/core/src/{components/pure/ModalContent.test/index/web → lib/TipoSkripto.test/TipoSkripto/node}/lint_errors.txt +0 -0
  768. /package/testeranto/reports/core/src/{components/pure/AppFrame.test/index/web → lib/TipoSkripto.test/TipoSkripto/node}/message.txt +0 -0
  769. /package/testeranto/reports/core/src/lib/{core.test/core.test → TipoSkripto.test/TipoSkripto}/node/stdout.log +0 -0
@@ -1,4804 +0,0 @@
1
- import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
- import {
3
- Node_default
4
- } from "../../../chunk-JBB5E3XJ.mjs";
5
- import {
6
- andWhenProxy,
7
- butThenProxy,
8
- init_cjs_shim
9
- } from "../../../chunk-L67RWZ4W.mjs";
10
-
11
- // src/lib/pmProxy.test/index.ts
12
- init_cjs_shim();
13
-
14
- // src/lib/pmProxy.test/implementation.ts
15
- init_cjs_shim();
16
-
17
- // src/lib/pmProxy.test/mockPMBase.ts
18
- init_cjs_shim();
19
- var MockPMBase = class {
20
- constructor(configs) {
21
- this.calls = {};
22
- this.testResourceConfiguration = {};
23
- this.configs = configs || {};
24
- }
25
- // Common tracking functionality
26
- trackCall(method, args) {
27
- if (!this.calls[method]) {
28
- this.calls[method] = [];
29
- }
30
- this.calls[method].push(args);
31
- }
32
- getCallCount(method) {
33
- return this.calls[method]?.length || 0;
34
- }
35
- getLastCall(method) {
36
- const calls = this.calls[method];
37
- return calls ? calls[calls.length - 1] : null;
38
- }
39
- // Add missing methods used in tests
40
- // writeFileSync(path: string, content: string): Promise<boolean> {
41
- // this.trackCall('writeFileSync', { path, content });
42
- // return Promise.resolve(true);
43
- // }
44
- // end(uid: number): Promise<boolean> {
45
- // this.trackCall('end', { uid });
46
- // return Promise.resolve(true);
47
- // }
48
- // Minimal implementations of required methods
49
- launchSideCar(n, testName, projectName) {
50
- this.trackCall("launchSideCar", { n, testName, projectName });
51
- return Promise.resolve();
52
- }
53
- end(uid) {
54
- this.trackCall("end", { uid });
55
- console.debug(`Ending test with uid ${uid}`);
56
- return Promise.resolve(true);
57
- }
58
- // Add debug method
59
- debug(message) {
60
- console.debug(`[MockPMBase] ${message}`);
61
- this.trackCall("debug", { message });
62
- }
63
- writeFileSync(path, content, testName) {
64
- this.trackCall("writeFileSync", { path, content, testName });
65
- return Promise.resolve(true);
66
- }
67
- createWriteStream(path, testName) {
68
- this.trackCall("createWriteStream", { path, testName });
69
- return Promise.resolve(0);
70
- }
71
- screencast(opts, testName, page) {
72
- this.trackCall("screencast", { opts, testName, page });
73
- return Promise.resolve({});
74
- }
75
- customScreenShot(opts, testName, pageUid) {
76
- this.trackCall("customScreenShot", { opts, testName, pageUid });
77
- return Promise.resolve({});
78
- }
79
- testArtiFactoryfileWriter(tLog, callback) {
80
- return (fPath, value) => {
81
- this.trackCall("testArtiFactoryfileWriter", { fPath, value });
82
- callback(Promise.resolve());
83
- };
84
- }
85
- // Other required PM_Base methods with minimal implementations
86
- closePage(p) {
87
- return Promise.resolve();
88
- }
89
- $(selector, p) {
90
- return Promise.resolve();
91
- }
92
- click(selector, page) {
93
- return Promise.resolve();
94
- }
95
- goto(p, url) {
96
- return Promise.resolve();
97
- }
98
- newPage() {
99
- return Promise.resolve("mock-page");
100
- }
101
- pages() {
102
- return Promise.resolve(["mock-page"]);
103
- }
104
- waitForSelector(p, s) {
105
- return Promise.resolve(true);
106
- }
107
- focusOn(selector, p) {
108
- return Promise.resolve();
109
- }
110
- typeInto(value, p) {
111
- return Promise.resolve();
112
- }
113
- getAttribute(selector, attribute, p) {
114
- return Promise.resolve();
115
- }
116
- getInnerHtml(selector, p) {
117
- return Promise.resolve();
118
- }
119
- isDisabled(selector, p) {
120
- return Promise.resolve(false);
121
- }
122
- screencastStop(s) {
123
- return Promise.resolve();
124
- }
125
- existsSync(destFolder) {
126
- return false;
127
- }
128
- mkdirSync(fp) {
129
- return Promise.resolve();
130
- }
131
- write(uid, contents) {
132
- return Promise.resolve(true);
133
- }
134
- page(p) {
135
- return "mock-page";
136
- }
137
- doInPage(p, cb) {
138
- return Promise.resolve();
139
- }
140
- customclose() {
141
- return Promise.resolve();
142
- }
143
- };
144
-
145
- // src/lib/pmProxy.test/implementation.ts
146
- function createPathRewriter(basePath) {
147
- return (path) => {
148
- if (!path)
149
- return path;
150
- const normalizedPath = path.replace(/\\/g, "/");
151
- const normalizedBase = basePath.replace(/\\/g, "/");
152
- if (normalizedPath.startsWith("/")) {
153
- return `${normalizedBase}${normalizedPath}`;
154
- }
155
- if (normalizedPath.includes("../")) {
156
- const parts = normalizedPath.split("/");
157
- const baseParts = normalizedBase.split("/");
158
- for (const part of parts) {
159
- if (part === "..") {
160
- baseParts.pop();
161
- } else if (part !== ".") {
162
- baseParts.push(part);
163
- }
164
- }
165
- return baseParts.join("/");
166
- }
167
- return `${normalizedBase}/${normalizedPath}`;
168
- };
169
- }
170
- var implementation = {
171
- suites: {
172
- Default: "PM Proxy Tests"
173
- },
174
- givens: {
175
- SomeBaseString: (s) => s
176
- },
177
- whens: {
178
- // functions have no mutations
179
- },
180
- thens: {
181
- theButTheProxyReturns: (method, expectedPath) => (store) => {
182
- const mockPm = new MockPMBase();
183
- const filepath = "test/path";
184
- const rewritePath = createPathRewriter(`${filepath}/butThen`);
185
- let actualPath;
186
- let actualContent;
187
- try {
188
- switch (method) {
189
- case "writeFileSync":
190
- const content = expectedPath.includes("content") ? "test content" : "default content";
191
- butThenProxy(mockPm, filepath, {}).writeFileSync(
192
- expectedPath.includes("empty") ? "" : expectedPath.includes("nested") ? "nested/folder/test.txt" : expectedPath.includes("spaces") ? "file with spaces.txt" : expectedPath.includes("invalid") ? "../invalid.txt" : "test.txt",
193
- content
194
- );
195
- actualPath = mockPm.getLastCall("writeFileSync")?.path;
196
- actualContent = mockPm.getLastCall("writeFileSync")?.content;
197
- break;
198
- case "createWriteStream":
199
- butThenProxy(mockPm, filepath, {}).createWriteStream(
200
- expectedPath.includes("empty") ? "" : "stream.txt"
201
- );
202
- actualPath = mockPm.getLastCall("createWriteStream")?.path;
203
- break;
204
- case "screencast":
205
- butThenProxy(mockPm, filepath, {}).screencast(
206
- {
207
- path: "screen.png",
208
- quality: 80,
209
- fullPage: true
210
- },
211
- "test"
212
- );
213
- actualPath = mockPm.getLastCall("screencast")?.opts?.path;
214
- actualContent = mockPm.getLastCall("screencast")?.opts;
215
- break;
216
- case "customScreenShot":
217
- butThenProxy(mockPm, filepath, {}).customScreenShot({ path: "shot.png" }, "test");
218
- actualPath = mockPm.getLastCall("customScreenShot")?.opts?.path;
219
- break;
220
- default:
221
- throw new Error(`Unknown method: ${method}`);
222
- }
223
- if (expectedPath === void 0) {
224
- return [void 0, void 0];
225
- }
226
- return [actualPath, expectedPath, actualContent];
227
- } catch (error) {
228
- return [error.message, expectedPath];
229
- }
230
- },
231
- verifyContent: (expectedContent) => (result) => {
232
- const actualContent = result[2];
233
- if (JSON.stringify(actualContent) !== JSON.stringify(expectedContent)) {
234
- throw new Error(
235
- `Content mismatch. Expected: ${JSON.stringify(
236
- expectedContent
237
- )}, Got: ${JSON.stringify(actualContent)}`
238
- );
239
- }
240
- return result;
241
- }
242
- }
243
- };
244
-
245
- // src/lib/pmProxy.test/specification.ts
246
- init_cjs_shim();
247
- var specification = (Suite, Given, When, Then) => [
248
- Suite.Default("PM Proxy Functionality", {
249
- // Basic path rewriting tests
250
- writeFileProxyTest: Given.SomeBaseString(
251
- ["butThenProxy should rewrite writeFileSync paths"],
252
- [],
253
- [
254
- Then.theButTheProxyReturns(
255
- "writeFileSync",
256
- "test/path/butThen/test.txt"
257
- )
258
- ],
259
- "writeFileSync test"
260
- ),
261
- createWriteStreamProxyTest: Given.SomeBaseString(
262
- ["butThenProxy should rewrite createWriteStream paths"],
263
- [],
264
- [
265
- Then.theButTheProxyReturns(
266
- "createWriteStream",
267
- "test/path/butThen/stream.txt"
268
- )
269
- ],
270
- "createWriteStream test"
271
- ),
272
- screencastProxyTest: Given.SomeBaseString(
273
- ["butThenProxy should rewrite screencast paths"],
274
- [],
275
- [
276
- Then.theButTheProxyReturns(
277
- "screencast",
278
- "test/path/butThen/screen.png"
279
- )
280
- ],
281
- "screencast test"
282
- ),
283
- customScreenShotProxyTest: Given.SomeBaseString(
284
- ["butThenProxy should rewrite customScreenShot paths"],
285
- [],
286
- [
287
- Then.theButTheProxyReturns(
288
- "customScreenShot",
289
- "test/path/butThen/shot.png"
290
- )
291
- ],
292
- "customScreenShot test"
293
- ),
294
- // Edge cases
295
- emptyPathTest: Given.SomeBaseString(
296
- ["butThenProxy should handle empty paths"],
297
- [],
298
- [Then.theButTheProxyReturns("writeFileSync", "test/path/butThen/")],
299
- "empty path test"
300
- ),
301
- nestedPathTest: Given.SomeBaseString(
302
- ["butThenProxy should handle nested paths"],
303
- [],
304
- [
305
- Then.theButTheProxyReturns(
306
- "writeFileSync",
307
- "test/path/butThen/nested/folder/test.txt"
308
- )
309
- ],
310
- "nested path test"
311
- ),
312
- specialCharsTest: Given.SomeBaseString(
313
- ["butThenProxy should handle special characters in paths"],
314
- [],
315
- [
316
- Then.theButTheProxyReturns(
317
- "writeFileSync",
318
- "test/path/butThen/file with spaces.txt"
319
- )
320
- ],
321
- "special chars test"
322
- )
323
- }),
324
- Suite.Default("Proxy Type Coverage", {
325
- // Test all proxy types
326
- butThenProxyTest: Given.SomeBaseString(
327
- ["butThenProxy should work correctly"],
328
- [],
329
- [
330
- Then.theButTheProxyReturns(
331
- "writeFileSync",
332
- "test/path/butThen/test.txt"
333
- )
334
- ],
335
- "butThenProxy test"
336
- ),
337
- andWhenProxyTest: Given.SomeBaseString(
338
- ["andWhenProxy should work correctly"],
339
- [],
340
- [
341
- Then.theButTheProxyReturns(
342
- "writeFileSync",
343
- "test/path/andWhen/test.txt"
344
- )
345
- ],
346
- "andWhenProxy test"
347
- ),
348
- beforeEachProxyTest: Given.SomeBaseString(
349
- ["beforeEachProxy should work correctly"],
350
- [],
351
- [
352
- Then.theButTheProxyReturns(
353
- "writeFileSync",
354
- "suite-1/beforeEach/test.txt"
355
- )
356
- ],
357
- "beforeEachProxy test"
358
- ),
359
- afterEachProxyTest: Given.SomeBaseString(
360
- ["afterEachProxy should work correctly"],
361
- [],
362
- [
363
- Then.theButTheProxyReturns(
364
- "writeFileSync",
365
- "suite-1/given-1/afterEach/test.txt"
366
- )
367
- ],
368
- "afterEachProxy test"
369
- )
370
- }),
371
- Suite.Default("Content Preservation", {
372
- // Verify content is preserved
373
- contentPreservationTest: Given.SomeBaseString(
374
- ["Proxies should preserve file content"],
375
- [],
376
- [
377
- Then.theButTheProxyReturns(
378
- "writeFileSync",
379
- "test/path/butThen/test.txt"
380
- ),
381
- Then.verifyContent("test content")
382
- ],
383
- "content preservation test"
384
- ),
385
- objectContentTest: Given.SomeBaseString(
386
- ["Proxies should preserve object content"],
387
- [],
388
- [
389
- Then.theButTheProxyReturns(
390
- "screencast",
391
- "test/path/butThen/screen.png"
392
- ),
393
- Then.verifyContent({ quality: 80, fullPage: true })
394
- ],
395
- "object content test"
396
- )
397
- }),
398
- Suite.Default("Error Cases", {
399
- invalidPathTest: Given.SomeBaseString(
400
- ["Proxies should handle invalid paths"],
401
- [],
402
- [
403
- Then.theButTheProxyReturns(
404
- "writeFileSync",
405
- "test/path/butThen/../invalid.txt"
406
- )
407
- ],
408
- "invalid path test"
409
- ),
410
- undefinedInputTest: Given.SomeBaseString(
411
- ["Proxies should handle undefined inputs"],
412
- [],
413
- [Then.theButTheProxyReturns("writeFileSync", void 0)],
414
- "undefined input test"
415
- )
416
- })
417
- ];
418
-
419
- // src/lib/pmProxy.test/adapter.ts
420
- init_cjs_shim();
421
-
422
- // node_modules/chai/chai.js
423
- init_cjs_shim();
424
- var __defProp = Object.defineProperty;
425
- var __getOwnPropNames = Object.getOwnPropertyNames;
426
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
427
- var __commonJS = (cb, mod) => function __require() {
428
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
429
- };
430
- var __export = (target, all) => {
431
- for (var name in all)
432
- __defProp(target, name, { get: all[name], enumerable: true });
433
- };
434
- var require_util = __commonJS({
435
- "(disabled):util"() {
436
- }
437
- });
438
- var utils_exports = {};
439
- __export(utils_exports, {
440
- addChainableMethod: () => addChainableMethod,
441
- addLengthGuard: () => addLengthGuard,
442
- addMethod: () => addMethod,
443
- addProperty: () => addProperty,
444
- checkError: () => check_error_exports,
445
- compareByInspect: () => compareByInspect,
446
- eql: () => deep_eql_default,
447
- expectTypes: () => expectTypes,
448
- flag: () => flag,
449
- getActual: () => getActual,
450
- getMessage: () => getMessage2,
451
- getName: () => getName,
452
- getOperator: () => getOperator,
453
- getOwnEnumerableProperties: () => getOwnEnumerableProperties,
454
- getOwnEnumerablePropertySymbols: () => getOwnEnumerablePropertySymbols,
455
- getPathInfo: () => getPathInfo,
456
- hasProperty: () => hasProperty,
457
- inspect: () => inspect2,
458
- isNaN: () => isNaN2,
459
- isNumeric: () => isNumeric,
460
- isProxyEnabled: () => isProxyEnabled,
461
- isRegExp: () => isRegExp2,
462
- objDisplay: () => objDisplay,
463
- overwriteChainableMethod: () => overwriteChainableMethod,
464
- overwriteMethod: () => overwriteMethod,
465
- overwriteProperty: () => overwriteProperty,
466
- proxify: () => proxify,
467
- test: () => test,
468
- transferFlags: () => transferFlags,
469
- type: () => type
470
- });
471
- var check_error_exports = {};
472
- __export(check_error_exports, {
473
- compatibleConstructor: () => compatibleConstructor,
474
- compatibleInstance: () => compatibleInstance,
475
- compatibleMessage: () => compatibleMessage,
476
- getConstructorName: () => getConstructorName,
477
- getMessage: () => getMessage
478
- });
479
- function isErrorInstance(obj) {
480
- return obj instanceof Error || Object.prototype.toString.call(obj) === "[object Error]";
481
- }
482
- __name(isErrorInstance, "isErrorInstance");
483
- function isRegExp(obj) {
484
- return Object.prototype.toString.call(obj) === "[object RegExp]";
485
- }
486
- __name(isRegExp, "isRegExp");
487
- function compatibleInstance(thrown, errorLike) {
488
- return isErrorInstance(errorLike) && thrown === errorLike;
489
- }
490
- __name(compatibleInstance, "compatibleInstance");
491
- function compatibleConstructor(thrown, errorLike) {
492
- if (isErrorInstance(errorLike)) {
493
- return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor;
494
- } else if ((typeof errorLike === "object" || typeof errorLike === "function") && errorLike.prototype) {
495
- return thrown.constructor === errorLike || thrown instanceof errorLike;
496
- }
497
- return false;
498
- }
499
- __name(compatibleConstructor, "compatibleConstructor");
500
- function compatibleMessage(thrown, errMatcher) {
501
- const comparisonString = typeof thrown === "string" ? thrown : thrown.message;
502
- if (isRegExp(errMatcher)) {
503
- return errMatcher.test(comparisonString);
504
- } else if (typeof errMatcher === "string") {
505
- return comparisonString.indexOf(errMatcher) !== -1;
506
- }
507
- return false;
508
- }
509
- __name(compatibleMessage, "compatibleMessage");
510
- function getConstructorName(errorLike) {
511
- let constructorName = errorLike;
512
- if (isErrorInstance(errorLike)) {
513
- constructorName = errorLike.constructor.name;
514
- } else if (typeof errorLike === "function") {
515
- constructorName = errorLike.name;
516
- if (constructorName === "") {
517
- const newConstructorName = new errorLike().name;
518
- constructorName = newConstructorName || constructorName;
519
- }
520
- }
521
- return constructorName;
522
- }
523
- __name(getConstructorName, "getConstructorName");
524
- function getMessage(errorLike) {
525
- let msg = "";
526
- if (errorLike && errorLike.message) {
527
- msg = errorLike.message;
528
- } else if (typeof errorLike === "string") {
529
- msg = errorLike;
530
- }
531
- return msg;
532
- }
533
- __name(getMessage, "getMessage");
534
- function flag(obj, key, value) {
535
- let flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null));
536
- if (arguments.length === 3) {
537
- flags[key] = value;
538
- } else {
539
- return flags[key];
540
- }
541
- }
542
- __name(flag, "flag");
543
- function test(obj, args) {
544
- let negate = flag(obj, "negate"), expr = args[0];
545
- return negate ? !expr : expr;
546
- }
547
- __name(test, "test");
548
- function type(obj) {
549
- if (typeof obj === "undefined") {
550
- return "undefined";
551
- }
552
- if (obj === null) {
553
- return "null";
554
- }
555
- const stringTag = obj[Symbol.toStringTag];
556
- if (typeof stringTag === "string") {
557
- return stringTag;
558
- }
559
- const type3 = Object.prototype.toString.call(obj).slice(8, -1);
560
- return type3;
561
- }
562
- __name(type, "type");
563
- var canElideFrames = "captureStackTrace" in Error;
564
- var AssertionError = class _AssertionError extends Error {
565
- static {
566
- __name(this, "AssertionError");
567
- }
568
- message;
569
- get name() {
570
- return "AssertionError";
571
- }
572
- get ok() {
573
- return false;
574
- }
575
- constructor(message = "Unspecified AssertionError", props, ssf) {
576
- super(message);
577
- this.message = message;
578
- if (canElideFrames) {
579
- Error.captureStackTrace(this, ssf || _AssertionError);
580
- }
581
- for (const key in props) {
582
- if (!(key in this)) {
583
- this[key] = props[key];
584
- }
585
- }
586
- }
587
- toJSON(stack) {
588
- return {
589
- ...this,
590
- name: this.name,
591
- message: this.message,
592
- ok: false,
593
- stack: stack !== false ? this.stack : void 0
594
- };
595
- }
596
- };
597
- function expectTypes(obj, types) {
598
- let flagMsg = flag(obj, "message");
599
- let ssfi = flag(obj, "ssfi");
600
- flagMsg = flagMsg ? flagMsg + ": " : "";
601
- obj = flag(obj, "object");
602
- types = types.map(function(t) {
603
- return t.toLowerCase();
604
- });
605
- types.sort();
606
- let str = types.map(function(t, index) {
607
- let art = ~["a", "e", "i", "o", "u"].indexOf(t.charAt(0)) ? "an" : "a";
608
- let or = types.length > 1 && index === types.length - 1 ? "or " : "";
609
- return or + art + " " + t;
610
- }).join(", ");
611
- let objType = type(obj).toLowerCase();
612
- if (!types.some(function(expected) {
613
- return objType === expected;
614
- })) {
615
- throw new AssertionError(
616
- flagMsg + "object tested must be " + str + ", but " + objType + " given",
617
- void 0,
618
- ssfi
619
- );
620
- }
621
- }
622
- __name(expectTypes, "expectTypes");
623
- function getActual(obj, args) {
624
- return args.length > 4 ? args[4] : obj._obj;
625
- }
626
- __name(getActual, "getActual");
627
- var ansiColors = {
628
- bold: ["1", "22"],
629
- dim: ["2", "22"],
630
- italic: ["3", "23"],
631
- underline: ["4", "24"],
632
- // 5 & 6 are blinking
633
- inverse: ["7", "27"],
634
- hidden: ["8", "28"],
635
- strike: ["9", "29"],
636
- // 10-20 are fonts
637
- // 21-29 are resets for 1-9
638
- black: ["30", "39"],
639
- red: ["31", "39"],
640
- green: ["32", "39"],
641
- yellow: ["33", "39"],
642
- blue: ["34", "39"],
643
- magenta: ["35", "39"],
644
- cyan: ["36", "39"],
645
- white: ["37", "39"],
646
- brightblack: ["30;1", "39"],
647
- brightred: ["31;1", "39"],
648
- brightgreen: ["32;1", "39"],
649
- brightyellow: ["33;1", "39"],
650
- brightblue: ["34;1", "39"],
651
- brightmagenta: ["35;1", "39"],
652
- brightcyan: ["36;1", "39"],
653
- brightwhite: ["37;1", "39"],
654
- grey: ["90", "39"]
655
- };
656
- var styles = {
657
- special: "cyan",
658
- number: "yellow",
659
- bigint: "yellow",
660
- boolean: "yellow",
661
- undefined: "grey",
662
- null: "bold",
663
- string: "green",
664
- symbol: "green",
665
- date: "magenta",
666
- regexp: "red"
667
- };
668
- var truncator = "\u2026";
669
- function colorise(value, styleType) {
670
- const color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
671
- if (!color) {
672
- return String(value);
673
- }
674
- return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`;
675
- }
676
- __name(colorise, "colorise");
677
- function normaliseOptions({
678
- showHidden = false,
679
- depth = 2,
680
- colors = false,
681
- customInspect = true,
682
- showProxy = false,
683
- maxArrayLength = Infinity,
684
- breakLength = Infinity,
685
- seen = [],
686
- // eslint-disable-next-line no-shadow
687
- truncate: truncate2 = Infinity,
688
- stylize = String
689
- } = {}, inspect3) {
690
- const options = {
691
- showHidden: Boolean(showHidden),
692
- depth: Number(depth),
693
- colors: Boolean(colors),
694
- customInspect: Boolean(customInspect),
695
- showProxy: Boolean(showProxy),
696
- maxArrayLength: Number(maxArrayLength),
697
- breakLength: Number(breakLength),
698
- truncate: Number(truncate2),
699
- seen,
700
- inspect: inspect3,
701
- stylize
702
- };
703
- if (options.colors) {
704
- options.stylize = colorise;
705
- }
706
- return options;
707
- }
708
- __name(normaliseOptions, "normaliseOptions");
709
- function isHighSurrogate(char) {
710
- return char >= "\uD800" && char <= "\uDBFF";
711
- }
712
- __name(isHighSurrogate, "isHighSurrogate");
713
- function truncate(string, length, tail = truncator) {
714
- string = String(string);
715
- const tailLength = tail.length;
716
- const stringLength = string.length;
717
- if (tailLength > length && stringLength > tailLength) {
718
- return tail;
719
- }
720
- if (stringLength > length && stringLength > tailLength) {
721
- let end = length - tailLength;
722
- if (end > 0 && isHighSurrogate(string[end - 1])) {
723
- end = end - 1;
724
- }
725
- return `${string.slice(0, end)}${tail}`;
726
- }
727
- return string;
728
- }
729
- __name(truncate, "truncate");
730
- function inspectList(list, options, inspectItem, separator = ", ") {
731
- inspectItem = inspectItem || options.inspect;
732
- const size = list.length;
733
- if (size === 0)
734
- return "";
735
- const originalLength = options.truncate;
736
- let output = "";
737
- let peek = "";
738
- let truncated = "";
739
- for (let i = 0; i < size; i += 1) {
740
- const last = i + 1 === list.length;
741
- const secondToLast = i + 2 === list.length;
742
- truncated = `${truncator}(${list.length - i})`;
743
- const value = list[i];
744
- options.truncate = originalLength - output.length - (last ? 0 : separator.length);
745
- const string = peek || inspectItem(value, options) + (last ? "" : separator);
746
- const nextLength = output.length + string.length;
747
- const truncatedLength = nextLength + truncated.length;
748
- if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) {
749
- break;
750
- }
751
- if (!last && !secondToLast && truncatedLength > originalLength) {
752
- break;
753
- }
754
- peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
755
- if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {
756
- break;
757
- }
758
- output += string;
759
- if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
760
- truncated = `${truncator}(${list.length - i - 1})`;
761
- break;
762
- }
763
- truncated = "";
764
- }
765
- return `${output}${truncated}`;
766
- }
767
- __name(inspectList, "inspectList");
768
- function quoteComplexKey(key) {
769
- if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
770
- return key;
771
- }
772
- return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
773
- }
774
- __name(quoteComplexKey, "quoteComplexKey");
775
- function inspectProperty([key, value], options) {
776
- options.truncate -= 2;
777
- if (typeof key === "string") {
778
- key = quoteComplexKey(key);
779
- } else if (typeof key !== "number") {
780
- key = `[${options.inspect(key, options)}]`;
781
- }
782
- options.truncate -= key.length;
783
- value = options.inspect(value, options);
784
- return `${key}: ${value}`;
785
- }
786
- __name(inspectProperty, "inspectProperty");
787
- function inspectArray(array, options) {
788
- const nonIndexProperties = Object.keys(array).slice(array.length);
789
- if (!array.length && !nonIndexProperties.length)
790
- return "[]";
791
- options.truncate -= 4;
792
- const listContents = inspectList(array, options);
793
- options.truncate -= listContents.length;
794
- let propertyContents = "";
795
- if (nonIndexProperties.length) {
796
- propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
797
- }
798
- return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
799
- }
800
- __name(inspectArray, "inspectArray");
801
- var getArrayName = /* @__PURE__ */ __name((array) => {
802
- if (typeof Buffer === "function" && array instanceof Buffer) {
803
- return "Buffer";
804
- }
805
- if (array[Symbol.toStringTag]) {
806
- return array[Symbol.toStringTag];
807
- }
808
- return array.constructor.name;
809
- }, "getArrayName");
810
- function inspectTypedArray(array, options) {
811
- const name = getArrayName(array);
812
- options.truncate -= name.length + 4;
813
- const nonIndexProperties = Object.keys(array).slice(array.length);
814
- if (!array.length && !nonIndexProperties.length)
815
- return `${name}[]`;
816
- let output = "";
817
- for (let i = 0; i < array.length; i++) {
818
- const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
819
- options.truncate -= string.length;
820
- if (array[i] !== array.length && options.truncate <= 3) {
821
- output += `${truncator}(${array.length - array[i] + 1})`;
822
- break;
823
- }
824
- output += string;
825
- }
826
- let propertyContents = "";
827
- if (nonIndexProperties.length) {
828
- propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
829
- }
830
- return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
831
- }
832
- __name(inspectTypedArray, "inspectTypedArray");
833
- function inspectDate(dateObject, options) {
834
- const stringRepresentation = dateObject.toJSON();
835
- if (stringRepresentation === null) {
836
- return "Invalid Date";
837
- }
838
- const split = stringRepresentation.split("T");
839
- const date = split[0];
840
- return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
841
- }
842
- __name(inspectDate, "inspectDate");
843
- function inspectFunction(func, options) {
844
- const functionType = func[Symbol.toStringTag] || "Function";
845
- const name = func.name;
846
- if (!name) {
847
- return options.stylize(`[${functionType}]`, "special");
848
- }
849
- return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special");
850
- }
851
- __name(inspectFunction, "inspectFunction");
852
- function inspectMapEntry([key, value], options) {
853
- options.truncate -= 4;
854
- key = options.inspect(key, options);
855
- options.truncate -= key.length;
856
- value = options.inspect(value, options);
857
- return `${key} => ${value}`;
858
- }
859
- __name(inspectMapEntry, "inspectMapEntry");
860
- function mapToEntries(map) {
861
- const entries = [];
862
- map.forEach((value, key) => {
863
- entries.push([key, value]);
864
- });
865
- return entries;
866
- }
867
- __name(mapToEntries, "mapToEntries");
868
- function inspectMap(map, options) {
869
- const size = map.size - 1;
870
- if (size <= 0) {
871
- return "Map{}";
872
- }
873
- options.truncate -= 7;
874
- return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
875
- }
876
- __name(inspectMap, "inspectMap");
877
- var isNaN = Number.isNaN || ((i) => i !== i);
878
- function inspectNumber(number, options) {
879
- if (isNaN(number)) {
880
- return options.stylize("NaN", "number");
881
- }
882
- if (number === Infinity) {
883
- return options.stylize("Infinity", "number");
884
- }
885
- if (number === -Infinity) {
886
- return options.stylize("-Infinity", "number");
887
- }
888
- if (number === 0) {
889
- return options.stylize(1 / number === Infinity ? "+0" : "-0", "number");
890
- }
891
- return options.stylize(truncate(String(number), options.truncate), "number");
892
- }
893
- __name(inspectNumber, "inspectNumber");
894
- function inspectBigInt(number, options) {
895
- let nums = truncate(number.toString(), options.truncate - 1);
896
- if (nums !== truncator)
897
- nums += "n";
898
- return options.stylize(nums, "bigint");
899
- }
900
- __name(inspectBigInt, "inspectBigInt");
901
- function inspectRegExp(value, options) {
902
- const flags = value.toString().split("/")[2];
903
- const sourceLength = options.truncate - (2 + flags.length);
904
- const source = value.source;
905
- return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp");
906
- }
907
- __name(inspectRegExp, "inspectRegExp");
908
- function arrayFromSet(set2) {
909
- const values = [];
910
- set2.forEach((value) => {
911
- values.push(value);
912
- });
913
- return values;
914
- }
915
- __name(arrayFromSet, "arrayFromSet");
916
- function inspectSet(set2, options) {
917
- if (set2.size === 0)
918
- return "Set{}";
919
- options.truncate -= 7;
920
- return `Set{ ${inspectList(arrayFromSet(set2), options)} }`;
921
- }
922
- __name(inspectSet, "inspectSet");
923
- var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
924
- var escapeCharacters = {
925
- "\b": "\\b",
926
- " ": "\\t",
927
- "\n": "\\n",
928
- "\f": "\\f",
929
- "\r": "\\r",
930
- "'": "\\'",
931
- "\\": "\\\\"
932
- };
933
- var hex = 16;
934
- var unicodeLength = 4;
935
- function escape(char) {
936
- return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`;
937
- }
938
- __name(escape, "escape");
939
- function inspectString(string, options) {
940
- if (stringEscapeChars.test(string)) {
941
- string = string.replace(stringEscapeChars, escape);
942
- }
943
- return options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string");
944
- }
945
- __name(inspectString, "inspectString");
946
- function inspectSymbol(value) {
947
- if ("description" in Symbol.prototype) {
948
- return value.description ? `Symbol(${value.description})` : "Symbol()";
949
- }
950
- return value.toString();
951
- }
952
- __name(inspectSymbol, "inspectSymbol");
953
- var getPromiseValue = /* @__PURE__ */ __name(() => "Promise{\u2026}", "getPromiseValue");
954
- try {
955
- const { getPromiseDetails, kPending, kRejected } = process.binding("util");
956
- if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
957
- getPromiseValue = /* @__PURE__ */ __name((value, options) => {
958
- const [state, innerValue] = getPromiseDetails(value);
959
- if (state === kPending) {
960
- return "Promise{<pending>}";
961
- }
962
- return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
963
- }, "getPromiseValue");
964
- }
965
- } catch (notNode) {
966
- }
967
- var promise_default = getPromiseValue;
968
- function inspectObject(object, options) {
969
- const properties = Object.getOwnPropertyNames(object);
970
- const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
971
- if (properties.length === 0 && symbols.length === 0) {
972
- return "{}";
973
- }
974
- options.truncate -= 4;
975
- options.seen = options.seen || [];
976
- if (options.seen.includes(object)) {
977
- return "[Circular]";
978
- }
979
- options.seen.push(object);
980
- const propertyContents = inspectList(properties.map((key) => [key, object[key]]), options, inspectProperty);
981
- const symbolContents = inspectList(symbols.map((key) => [key, object[key]]), options, inspectProperty);
982
- options.seen.pop();
983
- let sep = "";
984
- if (propertyContents && symbolContents) {
985
- sep = ", ";
986
- }
987
- return `{ ${propertyContents}${sep}${symbolContents} }`;
988
- }
989
- __name(inspectObject, "inspectObject");
990
- var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
991
- function inspectClass(value, options) {
992
- let name = "";
993
- if (toStringTag && toStringTag in value) {
994
- name = value[toStringTag];
995
- }
996
- name = name || value.constructor.name;
997
- if (!name || name === "_class") {
998
- name = "<Anonymous Class>";
999
- }
1000
- options.truncate -= name.length;
1001
- return `${name}${inspectObject(value, options)}`;
1002
- }
1003
- __name(inspectClass, "inspectClass");
1004
- function inspectArguments(args, options) {
1005
- if (args.length === 0)
1006
- return "Arguments[]";
1007
- options.truncate -= 13;
1008
- return `Arguments[ ${inspectList(args, options)} ]`;
1009
- }
1010
- __name(inspectArguments, "inspectArguments");
1011
- var errorKeys = [
1012
- "stack",
1013
- "line",
1014
- "column",
1015
- "name",
1016
- "message",
1017
- "fileName",
1018
- "lineNumber",
1019
- "columnNumber",
1020
- "number",
1021
- "description",
1022
- "cause"
1023
- ];
1024
- function inspectObject2(error, options) {
1025
- const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1);
1026
- const name = error.name;
1027
- options.truncate -= name.length;
1028
- let message = "";
1029
- if (typeof error.message === "string") {
1030
- message = truncate(error.message, options.truncate);
1031
- } else {
1032
- properties.unshift("message");
1033
- }
1034
- message = message ? `: ${message}` : "";
1035
- options.truncate -= message.length + 5;
1036
- options.seen = options.seen || [];
1037
- if (options.seen.includes(error)) {
1038
- return "[Circular]";
1039
- }
1040
- options.seen.push(error);
1041
- const propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty);
1042
- return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
1043
- }
1044
- __name(inspectObject2, "inspectObject");
1045
- function inspectAttribute([key, value], options) {
1046
- options.truncate -= 3;
1047
- if (!value) {
1048
- return `${options.stylize(String(key), "yellow")}`;
1049
- }
1050
- return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
1051
- }
1052
- __name(inspectAttribute, "inspectAttribute");
1053
- function inspectHTMLCollection(collection, options) {
1054
- return inspectList(collection, options, inspectHTML, "\n");
1055
- }
1056
- __name(inspectHTMLCollection, "inspectHTMLCollection");
1057
- function inspectHTML(element, options) {
1058
- const properties = element.getAttributeNames();
1059
- const name = element.tagName.toLowerCase();
1060
- const head = options.stylize(`<${name}`, "special");
1061
- const headClose = options.stylize(`>`, "special");
1062
- const tail = options.stylize(`</${name}>`, "special");
1063
- options.truncate -= name.length * 2 + 5;
1064
- let propertyContents = "";
1065
- if (properties.length > 0) {
1066
- propertyContents += " ";
1067
- propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ");
1068
- }
1069
- options.truncate -= propertyContents.length;
1070
- const truncate2 = options.truncate;
1071
- let children = inspectHTMLCollection(element.children, options);
1072
- if (children && children.length > truncate2) {
1073
- children = `${truncator}(${element.children.length})`;
1074
- }
1075
- return `${head}${propertyContents}${headClose}${children}${tail}`;
1076
- }
1077
- __name(inspectHTML, "inspectHTML");
1078
- var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function";
1079
- var chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect";
1080
- var nodeInspect = false;
1081
- try {
1082
- const nodeUtil = require_util();
1083
- nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
1084
- } catch (noNodeInspect) {
1085
- nodeInspect = false;
1086
- }
1087
- var constructorMap = /* @__PURE__ */ new WeakMap();
1088
- var stringTagMap = {};
1089
- var baseTypesMap = {
1090
- undefined: /* @__PURE__ */ __name((value, options) => options.stylize("undefined", "undefined"), "undefined"),
1091
- null: /* @__PURE__ */ __name((value, options) => options.stylize("null", "null"), "null"),
1092
- boolean: /* @__PURE__ */ __name((value, options) => options.stylize(String(value), "boolean"), "boolean"),
1093
- Boolean: /* @__PURE__ */ __name((value, options) => options.stylize(String(value), "boolean"), "Boolean"),
1094
- number: inspectNumber,
1095
- Number: inspectNumber,
1096
- bigint: inspectBigInt,
1097
- BigInt: inspectBigInt,
1098
- string: inspectString,
1099
- String: inspectString,
1100
- function: inspectFunction,
1101
- Function: inspectFunction,
1102
- symbol: inspectSymbol,
1103
- // A Symbol polyfill will return `Symbol` not `symbol` from typedetect
1104
- Symbol: inspectSymbol,
1105
- Array: inspectArray,
1106
- Date: inspectDate,
1107
- Map: inspectMap,
1108
- Set: inspectSet,
1109
- RegExp: inspectRegExp,
1110
- Promise: promise_default,
1111
- // WeakSet, WeakMap are totally opaque to us
1112
- WeakSet: /* @__PURE__ */ __name((value, options) => options.stylize("WeakSet{\u2026}", "special"), "WeakSet"),
1113
- WeakMap: /* @__PURE__ */ __name((value, options) => options.stylize("WeakMap{\u2026}", "special"), "WeakMap"),
1114
- Arguments: inspectArguments,
1115
- Int8Array: inspectTypedArray,
1116
- Uint8Array: inspectTypedArray,
1117
- Uint8ClampedArray: inspectTypedArray,
1118
- Int16Array: inspectTypedArray,
1119
- Uint16Array: inspectTypedArray,
1120
- Int32Array: inspectTypedArray,
1121
- Uint32Array: inspectTypedArray,
1122
- Float32Array: inspectTypedArray,
1123
- Float64Array: inspectTypedArray,
1124
- Generator: /* @__PURE__ */ __name(() => "", "Generator"),
1125
- DataView: /* @__PURE__ */ __name(() => "", "DataView"),
1126
- ArrayBuffer: /* @__PURE__ */ __name(() => "", "ArrayBuffer"),
1127
- Error: inspectObject2,
1128
- HTMLCollection: inspectHTMLCollection,
1129
- NodeList: inspectHTMLCollection
1130
- };
1131
- var inspectCustom = /* @__PURE__ */ __name((value, options, type3) => {
1132
- if (chaiInspect in value && typeof value[chaiInspect] === "function") {
1133
- return value[chaiInspect](options);
1134
- }
1135
- if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === "function") {
1136
- return value[nodeInspect](options.depth, options);
1137
- }
1138
- if ("inspect" in value && typeof value.inspect === "function") {
1139
- return value.inspect(options.depth, options);
1140
- }
1141
- if ("constructor" in value && constructorMap.has(value.constructor)) {
1142
- return constructorMap.get(value.constructor)(value, options);
1143
- }
1144
- if (stringTagMap[type3]) {
1145
- return stringTagMap[type3](value, options);
1146
- }
1147
- return "";
1148
- }, "inspectCustom");
1149
- var toString = Object.prototype.toString;
1150
- function inspect(value, opts = {}) {
1151
- const options = normaliseOptions(opts, inspect);
1152
- const { customInspect } = options;
1153
- let type3 = value === null ? "null" : typeof value;
1154
- if (type3 === "object") {
1155
- type3 = toString.call(value).slice(8, -1);
1156
- }
1157
- if (type3 in baseTypesMap) {
1158
- return baseTypesMap[type3](value, options);
1159
- }
1160
- if (customInspect && value) {
1161
- const output = inspectCustom(value, options, type3);
1162
- if (output) {
1163
- if (typeof output === "string")
1164
- return output;
1165
- return inspect(output, options);
1166
- }
1167
- }
1168
- const proto = value ? Object.getPrototypeOf(value) : false;
1169
- if (proto === Object.prototype || proto === null) {
1170
- return inspectObject(value, options);
1171
- }
1172
- if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) {
1173
- return inspectHTML(value, options);
1174
- }
1175
- if ("constructor" in value) {
1176
- if (value.constructor !== Object) {
1177
- return inspectClass(value, options);
1178
- }
1179
- return inspectObject(value, options);
1180
- }
1181
- if (value === Object(value)) {
1182
- return inspectObject(value, options);
1183
- }
1184
- return options.stylize(String(value), type3);
1185
- }
1186
- __name(inspect, "inspect");
1187
- var config = {
1188
- /**
1189
- * ### config.includeStack
1190
- *
1191
- * User configurable property, influences whether stack trace
1192
- * is included in Assertion error message. Default of false
1193
- * suppresses stack trace in the error message.
1194
- *
1195
- * chai.config.includeStack = true; // enable stack on error
1196
- *
1197
- * @param {boolean}
1198
- * @public
1199
- */
1200
- includeStack: false,
1201
- /**
1202
- * ### config.showDiff
1203
- *
1204
- * User configurable property, influences whether or not
1205
- * the `showDiff` flag should be included in the thrown
1206
- * AssertionErrors. `false` will always be `false`; `true`
1207
- * will be true when the assertion has requested a diff
1208
- * be shown.
1209
- *
1210
- * @param {boolean}
1211
- * @public
1212
- */
1213
- showDiff: true,
1214
- /**
1215
- * ### config.truncateThreshold
1216
- *
1217
- * User configurable property, sets length threshold for actual and
1218
- * expected values in assertion errors. If this threshold is exceeded, for
1219
- * example for large data structures, the value is replaced with something
1220
- * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`.
1221
- *
1222
- * Set it to zero if you want to disable truncating altogether.
1223
- *
1224
- * This is especially userful when doing assertions on arrays: having this
1225
- * set to a reasonable large value makes the failure messages readily
1226
- * inspectable.
1227
- *
1228
- * chai.config.truncateThreshold = 0; // disable truncating
1229
- *
1230
- * @param {number}
1231
- * @public
1232
- */
1233
- truncateThreshold: 40,
1234
- /**
1235
- * ### config.useProxy
1236
- *
1237
- * User configurable property, defines if chai will use a Proxy to throw
1238
- * an error when a non-existent property is read, which protects users
1239
- * from typos when using property-based assertions.
1240
- *
1241
- * Set it to false if you want to disable this feature.
1242
- *
1243
- * chai.config.useProxy = false; // disable use of Proxy
1244
- *
1245
- * This feature is automatically disabled regardless of this config value
1246
- * in environments that don't support proxies.
1247
- *
1248
- * @param {boolean}
1249
- * @public
1250
- */
1251
- useProxy: true,
1252
- /**
1253
- * ### config.proxyExcludedKeys
1254
- *
1255
- * User configurable property, defines which properties should be ignored
1256
- * instead of throwing an error if they do not exist on the assertion.
1257
- * This is only applied if the environment Chai is running in supports proxies and
1258
- * if the `useProxy` configuration setting is enabled.
1259
- * By default, `then` and `inspect` will not throw an error if they do not exist on the
1260
- * assertion object because the `.inspect` property is read by `util.inspect` (for example, when
1261
- * using `console.log` on the assertion object) and `.then` is necessary for promise type-checking.
1262
- *
1263
- * // By default these keys will not throw an error if they do not exist on the assertion object
1264
- * chai.config.proxyExcludedKeys = ['then', 'inspect'];
1265
- *
1266
- * @param {Array}
1267
- * @public
1268
- */
1269
- proxyExcludedKeys: ["then", "catch", "inspect", "toJSON"],
1270
- /**
1271
- * ### config.deepEqual
1272
- *
1273
- * User configurable property, defines which a custom function to use for deepEqual
1274
- * comparisons.
1275
- * By default, the function used is the one from the `deep-eql` package without custom comparator.
1276
- *
1277
- * // use a custom comparator
1278
- * chai.config.deepEqual = (expected, actual) => {
1279
- * return chai.util.eql(expected, actual, {
1280
- * comparator: (expected, actual) => {
1281
- * // for non number comparison, use the default behavior
1282
- * if(typeof expected !== 'number') return null;
1283
- * // allow a difference of 10 between compared numbers
1284
- * return typeof actual === 'number' && Math.abs(actual - expected) < 10
1285
- * }
1286
- * })
1287
- * };
1288
- *
1289
- * @param {Function}
1290
- * @public
1291
- */
1292
- deepEqual: null
1293
- };
1294
- function inspect2(obj, showHidden, depth, colors) {
1295
- let options = {
1296
- colors,
1297
- depth: typeof depth === "undefined" ? 2 : depth,
1298
- showHidden,
1299
- truncate: config.truncateThreshold ? config.truncateThreshold : Infinity
1300
- };
1301
- return inspect(obj, options);
1302
- }
1303
- __name(inspect2, "inspect");
1304
- function objDisplay(obj) {
1305
- let str = inspect2(obj), type3 = Object.prototype.toString.call(obj);
1306
- if (config.truncateThreshold && str.length >= config.truncateThreshold) {
1307
- if (type3 === "[object Function]") {
1308
- return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]";
1309
- } else if (type3 === "[object Array]") {
1310
- return "[ Array(" + obj.length + ") ]";
1311
- } else if (type3 === "[object Object]") {
1312
- let keys = Object.keys(obj), kstr = keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", ");
1313
- return "{ Object (" + kstr + ") }";
1314
- } else {
1315
- return str;
1316
- }
1317
- } else {
1318
- return str;
1319
- }
1320
- }
1321
- __name(objDisplay, "objDisplay");
1322
- function getMessage2(obj, args) {
1323
- let negate = flag(obj, "negate");
1324
- let val = flag(obj, "object");
1325
- let expected = args[3];
1326
- let actual = getActual(obj, args);
1327
- let msg = negate ? args[2] : args[1];
1328
- let flagMsg = flag(obj, "message");
1329
- if (typeof msg === "function")
1330
- msg = msg();
1331
- msg = msg || "";
1332
- msg = msg.replace(/#\{this\}/g, function() {
1333
- return objDisplay(val);
1334
- }).replace(/#\{act\}/g, function() {
1335
- return objDisplay(actual);
1336
- }).replace(/#\{exp\}/g, function() {
1337
- return objDisplay(expected);
1338
- });
1339
- return flagMsg ? flagMsg + ": " + msg : msg;
1340
- }
1341
- __name(getMessage2, "getMessage");
1342
- function transferFlags(assertion, object, includeAll) {
1343
- let flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null));
1344
- if (!object.__flags) {
1345
- object.__flags = /* @__PURE__ */ Object.create(null);
1346
- }
1347
- includeAll = arguments.length === 3 ? includeAll : true;
1348
- for (let flag3 in flags) {
1349
- if (includeAll || flag3 !== "object" && flag3 !== "ssfi" && flag3 !== "lockSsfi" && flag3 != "message") {
1350
- object.__flags[flag3] = flags[flag3];
1351
- }
1352
- }
1353
- }
1354
- __name(transferFlags, "transferFlags");
1355
- function type2(obj) {
1356
- if (typeof obj === "undefined") {
1357
- return "undefined";
1358
- }
1359
- if (obj === null) {
1360
- return "null";
1361
- }
1362
- const stringTag = obj[Symbol.toStringTag];
1363
- if (typeof stringTag === "string") {
1364
- return stringTag;
1365
- }
1366
- const sliceStart = 8;
1367
- const sliceEnd = -1;
1368
- return Object.prototype.toString.call(obj).slice(sliceStart, sliceEnd);
1369
- }
1370
- __name(type2, "type");
1371
- function FakeMap() {
1372
- this._key = "chai/deep-eql__" + Math.random() + Date.now();
1373
- }
1374
- __name(FakeMap, "FakeMap");
1375
- FakeMap.prototype = {
1376
- get: /* @__PURE__ */ __name(function get(key) {
1377
- return key[this._key];
1378
- }, "get"),
1379
- set: /* @__PURE__ */ __name(function set(key, value) {
1380
- if (Object.isExtensible(key)) {
1381
- Object.defineProperty(key, this._key, {
1382
- value,
1383
- configurable: true
1384
- });
1385
- }
1386
- }, "set")
1387
- };
1388
- var MemoizeMap = typeof WeakMap === "function" ? WeakMap : FakeMap;
1389
- function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) {
1390
- if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) {
1391
- return null;
1392
- }
1393
- var leftHandMap = memoizeMap.get(leftHandOperand);
1394
- if (leftHandMap) {
1395
- var result = leftHandMap.get(rightHandOperand);
1396
- if (typeof result === "boolean") {
1397
- return result;
1398
- }
1399
- }
1400
- return null;
1401
- }
1402
- __name(memoizeCompare, "memoizeCompare");
1403
- function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) {
1404
- if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) {
1405
- return;
1406
- }
1407
- var leftHandMap = memoizeMap.get(leftHandOperand);
1408
- if (leftHandMap) {
1409
- leftHandMap.set(rightHandOperand, result);
1410
- } else {
1411
- leftHandMap = new MemoizeMap();
1412
- leftHandMap.set(rightHandOperand, result);
1413
- memoizeMap.set(leftHandOperand, leftHandMap);
1414
- }
1415
- }
1416
- __name(memoizeSet, "memoizeSet");
1417
- var deep_eql_default = deepEqual;
1418
- function deepEqual(leftHandOperand, rightHandOperand, options) {
1419
- if (options && options.comparator) {
1420
- return extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
1421
- }
1422
- var simpleResult = simpleEqual(leftHandOperand, rightHandOperand);
1423
- if (simpleResult !== null) {
1424
- return simpleResult;
1425
- }
1426
- return extensiveDeepEqual(leftHandOperand, rightHandOperand, options);
1427
- }
1428
- __name(deepEqual, "deepEqual");
1429
- function simpleEqual(leftHandOperand, rightHandOperand) {
1430
- if (leftHandOperand === rightHandOperand) {
1431
- return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand;
1432
- }
1433
- if (leftHandOperand !== leftHandOperand && // eslint-disable-line no-self-compare
1434
- rightHandOperand !== rightHandOperand) {
1435
- return true;
1436
- }
1437
- if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) {
1438
- return false;
1439
- }
1440
- return null;
1441
- }
1442
- __name(simpleEqual, "simpleEqual");
1443
- function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) {
1444
- options = options || {};
1445
- options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap();
1446
- var comparator = options && options.comparator;
1447
- var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize);
1448
- if (memoizeResultLeft !== null) {
1449
- return memoizeResultLeft;
1450
- }
1451
- var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize);
1452
- if (memoizeResultRight !== null) {
1453
- return memoizeResultRight;
1454
- }
1455
- if (comparator) {
1456
- var comparatorResult = comparator(leftHandOperand, rightHandOperand);
1457
- if (comparatorResult === false || comparatorResult === true) {
1458
- memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult);
1459
- return comparatorResult;
1460
- }
1461
- var simpleResult = simpleEqual(leftHandOperand, rightHandOperand);
1462
- if (simpleResult !== null) {
1463
- return simpleResult;
1464
- }
1465
- }
1466
- var leftHandType = type2(leftHandOperand);
1467
- if (leftHandType !== type2(rightHandOperand)) {
1468
- memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false);
1469
- return false;
1470
- }
1471
- memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true);
1472
- var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options);
1473
- memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result);
1474
- return result;
1475
- }
1476
- __name(extensiveDeepEqual, "extensiveDeepEqual");
1477
- function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) {
1478
- switch (leftHandType) {
1479
- case "String":
1480
- case "Number":
1481
- case "Boolean":
1482
- case "Date":
1483
- return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf());
1484
- case "Promise":
1485
- case "Symbol":
1486
- case "function":
1487
- case "WeakMap":
1488
- case "WeakSet":
1489
- return leftHandOperand === rightHandOperand;
1490
- case "Error":
1491
- return keysEqual(leftHandOperand, rightHandOperand, ["name", "message", "code"], options);
1492
- case "Arguments":
1493
- case "Int8Array":
1494
- case "Uint8Array":
1495
- case "Uint8ClampedArray":
1496
- case "Int16Array":
1497
- case "Uint16Array":
1498
- case "Int32Array":
1499
- case "Uint32Array":
1500
- case "Float32Array":
1501
- case "Float64Array":
1502
- case "Array":
1503
- return iterableEqual(leftHandOperand, rightHandOperand, options);
1504
- case "RegExp":
1505
- return regexpEqual(leftHandOperand, rightHandOperand);
1506
- case "Generator":
1507
- return generatorEqual(leftHandOperand, rightHandOperand, options);
1508
- case "DataView":
1509
- return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options);
1510
- case "ArrayBuffer":
1511
- return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options);
1512
- case "Set":
1513
- return entriesEqual(leftHandOperand, rightHandOperand, options);
1514
- case "Map":
1515
- return entriesEqual(leftHandOperand, rightHandOperand, options);
1516
- case "Temporal.PlainDate":
1517
- case "Temporal.PlainTime":
1518
- case "Temporal.PlainDateTime":
1519
- case "Temporal.Instant":
1520
- case "Temporal.ZonedDateTime":
1521
- case "Temporal.PlainYearMonth":
1522
- case "Temporal.PlainMonthDay":
1523
- return leftHandOperand.equals(rightHandOperand);
1524
- case "Temporal.Duration":
1525
- return leftHandOperand.total("nanoseconds") === rightHandOperand.total("nanoseconds");
1526
- case "Temporal.TimeZone":
1527
- case "Temporal.Calendar":
1528
- return leftHandOperand.toString() === rightHandOperand.toString();
1529
- default:
1530
- return objectEqual(leftHandOperand, rightHandOperand, options);
1531
- }
1532
- }
1533
- __name(extensiveDeepEqualByType, "extensiveDeepEqualByType");
1534
- function regexpEqual(leftHandOperand, rightHandOperand) {
1535
- return leftHandOperand.toString() === rightHandOperand.toString();
1536
- }
1537
- __name(regexpEqual, "regexpEqual");
1538
- function entriesEqual(leftHandOperand, rightHandOperand, options) {
1539
- try {
1540
- if (leftHandOperand.size !== rightHandOperand.size) {
1541
- return false;
1542
- }
1543
- if (leftHandOperand.size === 0) {
1544
- return true;
1545
- }
1546
- } catch (sizeError) {
1547
- return false;
1548
- }
1549
- var leftHandItems = [];
1550
- var rightHandItems = [];
1551
- leftHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) {
1552
- leftHandItems.push([key, value]);
1553
- }, "gatherEntries"));
1554
- rightHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) {
1555
- rightHandItems.push([key, value]);
1556
- }, "gatherEntries"));
1557
- return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options);
1558
- }
1559
- __name(entriesEqual, "entriesEqual");
1560
- function iterableEqual(leftHandOperand, rightHandOperand, options) {
1561
- var length = leftHandOperand.length;
1562
- if (length !== rightHandOperand.length) {
1563
- return false;
1564
- }
1565
- if (length === 0) {
1566
- return true;
1567
- }
1568
- var index = -1;
1569
- while (++index < length) {
1570
- if (deepEqual(leftHandOperand[index], rightHandOperand[index], options) === false) {
1571
- return false;
1572
- }
1573
- }
1574
- return true;
1575
- }
1576
- __name(iterableEqual, "iterableEqual");
1577
- function generatorEqual(leftHandOperand, rightHandOperand, options) {
1578
- return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options);
1579
- }
1580
- __name(generatorEqual, "generatorEqual");
1581
- function hasIteratorFunction(target) {
1582
- return typeof Symbol !== "undefined" && typeof target === "object" && typeof Symbol.iterator !== "undefined" && typeof target[Symbol.iterator] === "function";
1583
- }
1584
- __name(hasIteratorFunction, "hasIteratorFunction");
1585
- function getIteratorEntries(target) {
1586
- if (hasIteratorFunction(target)) {
1587
- try {
1588
- return getGeneratorEntries(target[Symbol.iterator]());
1589
- } catch (iteratorError) {
1590
- return [];
1591
- }
1592
- }
1593
- return [];
1594
- }
1595
- __name(getIteratorEntries, "getIteratorEntries");
1596
- function getGeneratorEntries(generator) {
1597
- var generatorResult = generator.next();
1598
- var accumulator = [generatorResult.value];
1599
- while (generatorResult.done === false) {
1600
- generatorResult = generator.next();
1601
- accumulator.push(generatorResult.value);
1602
- }
1603
- return accumulator;
1604
- }
1605
- __name(getGeneratorEntries, "getGeneratorEntries");
1606
- function getEnumerableKeys(target) {
1607
- var keys = [];
1608
- for (var key in target) {
1609
- keys.push(key);
1610
- }
1611
- return keys;
1612
- }
1613
- __name(getEnumerableKeys, "getEnumerableKeys");
1614
- function getEnumerableSymbols(target) {
1615
- var keys = [];
1616
- var allKeys = Object.getOwnPropertySymbols(target);
1617
- for (var i = 0; i < allKeys.length; i += 1) {
1618
- var key = allKeys[i];
1619
- if (Object.getOwnPropertyDescriptor(target, key).enumerable) {
1620
- keys.push(key);
1621
- }
1622
- }
1623
- return keys;
1624
- }
1625
- __name(getEnumerableSymbols, "getEnumerableSymbols");
1626
- function keysEqual(leftHandOperand, rightHandOperand, keys, options) {
1627
- var length = keys.length;
1628
- if (length === 0) {
1629
- return true;
1630
- }
1631
- for (var i = 0; i < length; i += 1) {
1632
- if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) {
1633
- return false;
1634
- }
1635
- }
1636
- return true;
1637
- }
1638
- __name(keysEqual, "keysEqual");
1639
- function objectEqual(leftHandOperand, rightHandOperand, options) {
1640
- var leftHandKeys = getEnumerableKeys(leftHandOperand);
1641
- var rightHandKeys = getEnumerableKeys(rightHandOperand);
1642
- var leftHandSymbols = getEnumerableSymbols(leftHandOperand);
1643
- var rightHandSymbols = getEnumerableSymbols(rightHandOperand);
1644
- leftHandKeys = leftHandKeys.concat(leftHandSymbols);
1645
- rightHandKeys = rightHandKeys.concat(rightHandSymbols);
1646
- if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) {
1647
- if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) {
1648
- return false;
1649
- }
1650
- return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options);
1651
- }
1652
- var leftHandEntries = getIteratorEntries(leftHandOperand);
1653
- var rightHandEntries = getIteratorEntries(rightHandOperand);
1654
- if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) {
1655
- leftHandEntries.sort();
1656
- rightHandEntries.sort();
1657
- return iterableEqual(leftHandEntries, rightHandEntries, options);
1658
- }
1659
- if (leftHandKeys.length === 0 && leftHandEntries.length === 0 && rightHandKeys.length === 0 && rightHandEntries.length === 0) {
1660
- return true;
1661
- }
1662
- return false;
1663
- }
1664
- __name(objectEqual, "objectEqual");
1665
- function isPrimitive(value) {
1666
- return value === null || typeof value !== "object";
1667
- }
1668
- __name(isPrimitive, "isPrimitive");
1669
- function mapSymbols(arr) {
1670
- return arr.map(/* @__PURE__ */ __name(function mapSymbol(entry) {
1671
- if (typeof entry === "symbol") {
1672
- return entry.toString();
1673
- }
1674
- return entry;
1675
- }, "mapSymbol"));
1676
- }
1677
- __name(mapSymbols, "mapSymbols");
1678
- function hasProperty(obj, name) {
1679
- if (typeof obj === "undefined" || obj === null) {
1680
- return false;
1681
- }
1682
- return name in Object(obj);
1683
- }
1684
- __name(hasProperty, "hasProperty");
1685
- function parsePath(path) {
1686
- const str = path.replace(/([^\\])\[/g, "$1.[");
1687
- const parts = str.match(/(\\\.|[^.]+?)+/g);
1688
- return parts.map((value) => {
1689
- if (value === "constructor" || value === "__proto__" || value === "prototype") {
1690
- return {};
1691
- }
1692
- const regexp = /^\[(\d+)\]$/;
1693
- const mArr = regexp.exec(value);
1694
- let parsed = null;
1695
- if (mArr) {
1696
- parsed = { i: parseFloat(mArr[1]) };
1697
- } else {
1698
- parsed = { p: value.replace(/\\([.[\]])/g, "$1") };
1699
- }
1700
- return parsed;
1701
- });
1702
- }
1703
- __name(parsePath, "parsePath");
1704
- function internalGetPathValue(obj, parsed, pathDepth) {
1705
- let temporaryValue = obj;
1706
- let res = null;
1707
- pathDepth = typeof pathDepth === "undefined" ? parsed.length : pathDepth;
1708
- for (let i = 0; i < pathDepth; i++) {
1709
- const part = parsed[i];
1710
- if (temporaryValue) {
1711
- if (typeof part.p === "undefined") {
1712
- temporaryValue = temporaryValue[part.i];
1713
- } else {
1714
- temporaryValue = temporaryValue[part.p];
1715
- }
1716
- if (i === pathDepth - 1) {
1717
- res = temporaryValue;
1718
- }
1719
- }
1720
- }
1721
- return res;
1722
- }
1723
- __name(internalGetPathValue, "internalGetPathValue");
1724
- function getPathInfo(obj, path) {
1725
- const parsed = parsePath(path);
1726
- const last = parsed[parsed.length - 1];
1727
- const info = {
1728
- parent: parsed.length > 1 ? internalGetPathValue(obj, parsed, parsed.length - 1) : obj,
1729
- name: last.p || last.i,
1730
- value: internalGetPathValue(obj, parsed)
1731
- };
1732
- info.exists = hasProperty(info.parent, info.name);
1733
- return info;
1734
- }
1735
- __name(getPathInfo, "getPathInfo");
1736
- var Assertion = class _Assertion {
1737
- static {
1738
- __name(this, "Assertion");
1739
- }
1740
- /** @type {{}} */
1741
- __flags = {};
1742
- /**
1743
- * Creates object for chaining.
1744
- * `Assertion` objects contain metadata in the form of flags. Three flags can
1745
- * be assigned during instantiation by passing arguments to this constructor:
1746
- *
1747
- * - `object`: This flag contains the target of the assertion. For example, in
1748
- * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will
1749
- * contain `numKittens` so that the `equal` assertion can reference it when
1750
- * needed.
1751
- *
1752
- * - `message`: This flag contains an optional custom error message to be
1753
- * prepended to the error message that's generated by the assertion when it
1754
- * fails.
1755
- *
1756
- * - `ssfi`: This flag stands for "start stack function indicator". It
1757
- * contains a function reference that serves as the starting point for
1758
- * removing frames from the stack trace of the error that's created by the
1759
- * assertion when it fails. The goal is to provide a cleaner stack trace to
1760
- * end users by removing Chai's internal functions. Note that it only works
1761
- * in environments that support `Error.captureStackTrace`, and only when
1762
- * `Chai.config.includeStack` hasn't been set to `false`.
1763
- *
1764
- * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
1765
- * should retain its current value, even as assertions are chained off of
1766
- * this object. This is usually set to `true` when creating a new assertion
1767
- * from within another assertion. It's also temporarily set to `true` before
1768
- * an overwritten assertion gets called by the overwriting assertion.
1769
- *
1770
- * - `eql`: This flag contains the deepEqual function to be used by the assertion.
1771
- *
1772
- * @param {unknown} obj target of the assertion
1773
- * @param {string} [msg] (optional) custom error message
1774
- * @param {Function} [ssfi] (optional) starting point for removing stack frames
1775
- * @param {boolean} [lockSsfi] (optional) whether or not the ssfi flag is locked
1776
- */
1777
- constructor(obj, msg, ssfi, lockSsfi) {
1778
- flag(this, "ssfi", ssfi || _Assertion);
1779
- flag(this, "lockSsfi", lockSsfi);
1780
- flag(this, "object", obj);
1781
- flag(this, "message", msg);
1782
- flag(this, "eql", config.deepEqual || deep_eql_default);
1783
- return proxify(this);
1784
- }
1785
- /** @returns {boolean} */
1786
- static get includeStack() {
1787
- console.warn(
1788
- "Assertion.includeStack is deprecated, use chai.config.includeStack instead."
1789
- );
1790
- return config.includeStack;
1791
- }
1792
- /** @param {boolean} value */
1793
- static set includeStack(value) {
1794
- console.warn(
1795
- "Assertion.includeStack is deprecated, use chai.config.includeStack instead."
1796
- );
1797
- config.includeStack = value;
1798
- }
1799
- /** @returns {boolean} */
1800
- static get showDiff() {
1801
- console.warn(
1802
- "Assertion.showDiff is deprecated, use chai.config.showDiff instead."
1803
- );
1804
- return config.showDiff;
1805
- }
1806
- /** @param {boolean} value */
1807
- static set showDiff(value) {
1808
- console.warn(
1809
- "Assertion.showDiff is deprecated, use chai.config.showDiff instead."
1810
- );
1811
- config.showDiff = value;
1812
- }
1813
- /**
1814
- * @param {string} name
1815
- * @param {Function} fn
1816
- */
1817
- static addProperty(name, fn) {
1818
- addProperty(this.prototype, name, fn);
1819
- }
1820
- /**
1821
- * @param {string} name
1822
- * @param {Function} fn
1823
- */
1824
- static addMethod(name, fn) {
1825
- addMethod(this.prototype, name, fn);
1826
- }
1827
- /**
1828
- * @param {string} name
1829
- * @param {Function} fn
1830
- * @param {Function} chainingBehavior
1831
- */
1832
- static addChainableMethod(name, fn, chainingBehavior) {
1833
- addChainableMethod(this.prototype, name, fn, chainingBehavior);
1834
- }
1835
- /**
1836
- * @param {string} name
1837
- * @param {Function} fn
1838
- */
1839
- static overwriteProperty(name, fn) {
1840
- overwriteProperty(this.prototype, name, fn);
1841
- }
1842
- /**
1843
- * @param {string} name
1844
- * @param {Function} fn
1845
- */
1846
- static overwriteMethod(name, fn) {
1847
- overwriteMethod(this.prototype, name, fn);
1848
- }
1849
- /**
1850
- * @param {string} name
1851
- * @param {Function} fn
1852
- * @param {Function} chainingBehavior
1853
- */
1854
- static overwriteChainableMethod(name, fn, chainingBehavior) {
1855
- overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
1856
- }
1857
- /**
1858
- * ### .assert(expression, message, negateMessage, expected, actual, showDiff)
1859
- *
1860
- * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
1861
- *
1862
- * @name assert
1863
- * @param {unknown} _expr to be tested
1864
- * @param {string | Function} msg or function that returns message to display if expression fails
1865
- * @param {string | Function} _negateMsg or function that returns negatedMessage to display if negated expression fails
1866
- * @param {unknown} expected value (remember to check for negation)
1867
- * @param {unknown} _actual (optional) will default to `this.obj`
1868
- * @param {boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
1869
- * @returns {void}
1870
- */
1871
- assert(_expr, msg, _negateMsg, expected, _actual, showDiff) {
1872
- const ok = test(this, arguments);
1873
- if (false !== showDiff)
1874
- showDiff = true;
1875
- if (void 0 === expected && void 0 === _actual)
1876
- showDiff = false;
1877
- if (true !== config.showDiff)
1878
- showDiff = false;
1879
- if (!ok) {
1880
- msg = getMessage2(this, arguments);
1881
- const actual = getActual(this, arguments);
1882
- const assertionErrorObjectProperties = {
1883
- actual,
1884
- expected,
1885
- showDiff
1886
- };
1887
- const operator = getOperator(this, arguments);
1888
- if (operator) {
1889
- assertionErrorObjectProperties.operator = operator;
1890
- }
1891
- throw new AssertionError(
1892
- msg,
1893
- assertionErrorObjectProperties,
1894
- // @ts-expect-error Not sure what to do about these types yet
1895
- config.includeStack ? this.assert : flag(this, "ssfi")
1896
- );
1897
- }
1898
- }
1899
- /**
1900
- * Quick reference to stored `actual` value for plugin developers.
1901
- *
1902
- * @returns {unknown}
1903
- */
1904
- get _obj() {
1905
- return flag(this, "object");
1906
- }
1907
- /**
1908
- * Quick reference to stored `actual` value for plugin developers.
1909
- *
1910
- * @param {unknown} val
1911
- */
1912
- set _obj(val) {
1913
- flag(this, "object", val);
1914
- }
1915
- };
1916
- function isProxyEnabled() {
1917
- return config.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined";
1918
- }
1919
- __name(isProxyEnabled, "isProxyEnabled");
1920
- function addProperty(ctx, name, getter) {
1921
- getter = getter === void 0 ? function() {
1922
- } : getter;
1923
- Object.defineProperty(ctx, name, {
1924
- get: /* @__PURE__ */ __name(function propertyGetter() {
1925
- if (!isProxyEnabled() && !flag(this, "lockSsfi")) {
1926
- flag(this, "ssfi", propertyGetter);
1927
- }
1928
- let result = getter.call(this);
1929
- if (result !== void 0)
1930
- return result;
1931
- let newAssertion = new Assertion();
1932
- transferFlags(this, newAssertion);
1933
- return newAssertion;
1934
- }, "propertyGetter"),
1935
- configurable: true
1936
- });
1937
- }
1938
- __name(addProperty, "addProperty");
1939
- var fnLengthDesc = Object.getOwnPropertyDescriptor(function() {
1940
- }, "length");
1941
- function addLengthGuard(fn, assertionName, isChainable) {
1942
- if (!fnLengthDesc.configurable)
1943
- return fn;
1944
- Object.defineProperty(fn, "length", {
1945
- get: /* @__PURE__ */ __name(function() {
1946
- if (isChainable) {
1947
- throw Error(
1948
- "Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.'
1949
- );
1950
- }
1951
- throw Error(
1952
- "Invalid Chai property: " + assertionName + '.length. See docs for proper usage of "' + assertionName + '".'
1953
- );
1954
- }, "get")
1955
- });
1956
- return fn;
1957
- }
1958
- __name(addLengthGuard, "addLengthGuard");
1959
- function getProperties(object) {
1960
- let result = Object.getOwnPropertyNames(object);
1961
- function addProperty2(property) {
1962
- if (result.indexOf(property) === -1) {
1963
- result.push(property);
1964
- }
1965
- }
1966
- __name(addProperty2, "addProperty");
1967
- let proto = Object.getPrototypeOf(object);
1968
- while (proto !== null) {
1969
- Object.getOwnPropertyNames(proto).forEach(addProperty2);
1970
- proto = Object.getPrototypeOf(proto);
1971
- }
1972
- return result;
1973
- }
1974
- __name(getProperties, "getProperties");
1975
- var builtins = ["__flags", "__methods", "_obj", "assert"];
1976
- function proxify(obj, nonChainableMethodName) {
1977
- if (!isProxyEnabled())
1978
- return obj;
1979
- return new Proxy(obj, {
1980
- get: /* @__PURE__ */ __name(function proxyGetter(target, property) {
1981
- if (typeof property === "string" && config.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) {
1982
- if (nonChainableMethodName) {
1983
- throw Error(
1984
- "Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".'
1985
- );
1986
- }
1987
- let suggestion = null;
1988
- let suggestionDistance = 4;
1989
- getProperties(target).forEach(function(prop) {
1990
- if (
1991
- // we actually mean to check `Object.prototype` here
1992
- // eslint-disable-next-line no-prototype-builtins
1993
- !Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1
1994
- ) {
1995
- let dist = stringDistanceCapped(property, prop, suggestionDistance);
1996
- if (dist < suggestionDistance) {
1997
- suggestion = prop;
1998
- suggestionDistance = dist;
1999
- }
2000
- }
2001
- });
2002
- if (suggestion !== null) {
2003
- throw Error(
2004
- "Invalid Chai property: " + property + '. Did you mean "' + suggestion + '"?'
2005
- );
2006
- } else {
2007
- throw Error("Invalid Chai property: " + property);
2008
- }
2009
- }
2010
- if (builtins.indexOf(property) === -1 && !flag(target, "lockSsfi")) {
2011
- flag(target, "ssfi", proxyGetter);
2012
- }
2013
- return Reflect.get(target, property);
2014
- }, "proxyGetter")
2015
- });
2016
- }
2017
- __name(proxify, "proxify");
2018
- function stringDistanceCapped(strA, strB, cap) {
2019
- if (Math.abs(strA.length - strB.length) >= cap) {
2020
- return cap;
2021
- }
2022
- let memo = [];
2023
- for (let i = 0; i <= strA.length; i++) {
2024
- memo[i] = Array(strB.length + 1).fill(0);
2025
- memo[i][0] = i;
2026
- }
2027
- for (let j = 0; j < strB.length; j++) {
2028
- memo[0][j] = j;
2029
- }
2030
- for (let i = 1; i <= strA.length; i++) {
2031
- let ch = strA.charCodeAt(i - 1);
2032
- for (let j = 1; j <= strB.length; j++) {
2033
- if (Math.abs(i - j) >= cap) {
2034
- memo[i][j] = cap;
2035
- continue;
2036
- }
2037
- memo[i][j] = Math.min(
2038
- memo[i - 1][j] + 1,
2039
- memo[i][j - 1] + 1,
2040
- memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1)
2041
- );
2042
- }
2043
- }
2044
- return memo[strA.length][strB.length];
2045
- }
2046
- __name(stringDistanceCapped, "stringDistanceCapped");
2047
- function addMethod(ctx, name, method) {
2048
- let methodWrapper = /* @__PURE__ */ __name(function() {
2049
- if (!flag(this, "lockSsfi")) {
2050
- flag(this, "ssfi", methodWrapper);
2051
- }
2052
- let result = method.apply(this, arguments);
2053
- if (result !== void 0)
2054
- return result;
2055
- let newAssertion = new Assertion();
2056
- transferFlags(this, newAssertion);
2057
- return newAssertion;
2058
- }, "methodWrapper");
2059
- addLengthGuard(methodWrapper, name, false);
2060
- ctx[name] = proxify(methodWrapper, name);
2061
- }
2062
- __name(addMethod, "addMethod");
2063
- function overwriteProperty(ctx, name, getter) {
2064
- let _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ __name(function() {
2065
- }, "_super");
2066
- if (_get && "function" === typeof _get.get)
2067
- _super = _get.get;
2068
- Object.defineProperty(ctx, name, {
2069
- get: /* @__PURE__ */ __name(function overwritingPropertyGetter() {
2070
- if (!isProxyEnabled() && !flag(this, "lockSsfi")) {
2071
- flag(this, "ssfi", overwritingPropertyGetter);
2072
- }
2073
- let origLockSsfi = flag(this, "lockSsfi");
2074
- flag(this, "lockSsfi", true);
2075
- let result = getter(_super).call(this);
2076
- flag(this, "lockSsfi", origLockSsfi);
2077
- if (result !== void 0) {
2078
- return result;
2079
- }
2080
- let newAssertion = new Assertion();
2081
- transferFlags(this, newAssertion);
2082
- return newAssertion;
2083
- }, "overwritingPropertyGetter"),
2084
- configurable: true
2085
- });
2086
- }
2087
- __name(overwriteProperty, "overwriteProperty");
2088
- function overwriteMethod(ctx, name, method) {
2089
- let _method = ctx[name], _super = /* @__PURE__ */ __name(function() {
2090
- throw new Error(name + " is not a function");
2091
- }, "_super");
2092
- if (_method && "function" === typeof _method)
2093
- _super = _method;
2094
- let overwritingMethodWrapper = /* @__PURE__ */ __name(function() {
2095
- if (!flag(this, "lockSsfi")) {
2096
- flag(this, "ssfi", overwritingMethodWrapper);
2097
- }
2098
- let origLockSsfi = flag(this, "lockSsfi");
2099
- flag(this, "lockSsfi", true);
2100
- let result = method(_super).apply(this, arguments);
2101
- flag(this, "lockSsfi", origLockSsfi);
2102
- if (result !== void 0) {
2103
- return result;
2104
- }
2105
- let newAssertion = new Assertion();
2106
- transferFlags(this, newAssertion);
2107
- return newAssertion;
2108
- }, "overwritingMethodWrapper");
2109
- addLengthGuard(overwritingMethodWrapper, name, false);
2110
- ctx[name] = proxify(overwritingMethodWrapper, name);
2111
- }
2112
- __name(overwriteMethod, "overwriteMethod");
2113
- var canSetPrototype = typeof Object.setPrototypeOf === "function";
2114
- var testFn = /* @__PURE__ */ __name(function() {
2115
- }, "testFn");
2116
- var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
2117
- let propDesc = Object.getOwnPropertyDescriptor(testFn, name);
2118
- if (typeof propDesc !== "object")
2119
- return true;
2120
- return !propDesc.configurable;
2121
- });
2122
- var call = Function.prototype.call;
2123
- var apply = Function.prototype.apply;
2124
- function addChainableMethod(ctx, name, method, chainingBehavior) {
2125
- if (typeof chainingBehavior !== "function") {
2126
- chainingBehavior = /* @__PURE__ */ __name(function() {
2127
- }, "chainingBehavior");
2128
- }
2129
- let chainableBehavior = {
2130
- method,
2131
- chainingBehavior
2132
- };
2133
- if (!ctx.__methods) {
2134
- ctx.__methods = {};
2135
- }
2136
- ctx.__methods[name] = chainableBehavior;
2137
- Object.defineProperty(ctx, name, {
2138
- get: /* @__PURE__ */ __name(function chainableMethodGetter() {
2139
- chainableBehavior.chainingBehavior.call(this);
2140
- let chainableMethodWrapper = /* @__PURE__ */ __name(function() {
2141
- if (!flag(this, "lockSsfi")) {
2142
- flag(this, "ssfi", chainableMethodWrapper);
2143
- }
2144
- let result = chainableBehavior.method.apply(this, arguments);
2145
- if (result !== void 0) {
2146
- return result;
2147
- }
2148
- let newAssertion = new Assertion();
2149
- transferFlags(this, newAssertion);
2150
- return newAssertion;
2151
- }, "chainableMethodWrapper");
2152
- addLengthGuard(chainableMethodWrapper, name, true);
2153
- if (canSetPrototype) {
2154
- let prototype = Object.create(this);
2155
- prototype.call = call;
2156
- prototype.apply = apply;
2157
- Object.setPrototypeOf(chainableMethodWrapper, prototype);
2158
- } else {
2159
- let asserterNames = Object.getOwnPropertyNames(ctx);
2160
- asserterNames.forEach(function(asserterName) {
2161
- if (excludeNames.indexOf(asserterName) !== -1) {
2162
- return;
2163
- }
2164
- let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
2165
- Object.defineProperty(chainableMethodWrapper, asserterName, pd);
2166
- });
2167
- }
2168
- transferFlags(this, chainableMethodWrapper);
2169
- return proxify(chainableMethodWrapper);
2170
- }, "chainableMethodGetter"),
2171
- configurable: true
2172
- });
2173
- }
2174
- __name(addChainableMethod, "addChainableMethod");
2175
- function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
2176
- let chainableBehavior = ctx.__methods[name];
2177
- let _chainingBehavior = chainableBehavior.chainingBehavior;
2178
- chainableBehavior.chainingBehavior = /* @__PURE__ */ __name(function overwritingChainableMethodGetter() {
2179
- let result = chainingBehavior(_chainingBehavior).call(this);
2180
- if (result !== void 0) {
2181
- return result;
2182
- }
2183
- let newAssertion = new Assertion();
2184
- transferFlags(this, newAssertion);
2185
- return newAssertion;
2186
- }, "overwritingChainableMethodGetter");
2187
- let _method = chainableBehavior.method;
2188
- chainableBehavior.method = /* @__PURE__ */ __name(function overwritingChainableMethodWrapper() {
2189
- let result = method(_method).apply(this, arguments);
2190
- if (result !== void 0) {
2191
- return result;
2192
- }
2193
- let newAssertion = new Assertion();
2194
- transferFlags(this, newAssertion);
2195
- return newAssertion;
2196
- }, "overwritingChainableMethodWrapper");
2197
- }
2198
- __name(overwriteChainableMethod, "overwriteChainableMethod");
2199
- function compareByInspect(a, b) {
2200
- return inspect2(a) < inspect2(b) ? -1 : 1;
2201
- }
2202
- __name(compareByInspect, "compareByInspect");
2203
- function getOwnEnumerablePropertySymbols(obj) {
2204
- if (typeof Object.getOwnPropertySymbols !== "function")
2205
- return [];
2206
- return Object.getOwnPropertySymbols(obj).filter(function(sym) {
2207
- return Object.getOwnPropertyDescriptor(obj, sym).enumerable;
2208
- });
2209
- }
2210
- __name(getOwnEnumerablePropertySymbols, "getOwnEnumerablePropertySymbols");
2211
- function getOwnEnumerableProperties(obj) {
2212
- return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj));
2213
- }
2214
- __name(getOwnEnumerableProperties, "getOwnEnumerableProperties");
2215
- var isNaN2 = Number.isNaN;
2216
- function isObjectType(obj) {
2217
- let objectType = type(obj);
2218
- let objectTypes = ["Array", "Object", "Function"];
2219
- return objectTypes.indexOf(objectType) !== -1;
2220
- }
2221
- __name(isObjectType, "isObjectType");
2222
- function getOperator(obj, args) {
2223
- let operator = flag(obj, "operator");
2224
- let negate = flag(obj, "negate");
2225
- let expected = args[3];
2226
- let msg = negate ? args[2] : args[1];
2227
- if (operator) {
2228
- return operator;
2229
- }
2230
- if (typeof msg === "function")
2231
- msg = msg();
2232
- msg = msg || "";
2233
- if (!msg) {
2234
- return void 0;
2235
- }
2236
- if (/\shave\s/.test(msg)) {
2237
- return void 0;
2238
- }
2239
- let isObject = isObjectType(expected);
2240
- if (/\snot\s/.test(msg)) {
2241
- return isObject ? "notDeepStrictEqual" : "notStrictEqual";
2242
- }
2243
- return isObject ? "deepStrictEqual" : "strictEqual";
2244
- }
2245
- __name(getOperator, "getOperator");
2246
- function getName(fn) {
2247
- return fn.name;
2248
- }
2249
- __name(getName, "getName");
2250
- function isRegExp2(obj) {
2251
- return Object.prototype.toString.call(obj) === "[object RegExp]";
2252
- }
2253
- __name(isRegExp2, "isRegExp");
2254
- function isNumeric(obj) {
2255
- return ["Number", "BigInt"].includes(type(obj));
2256
- }
2257
- __name(isNumeric, "isNumeric");
2258
- var { flag: flag2 } = utils_exports;
2259
- [
2260
- "to",
2261
- "be",
2262
- "been",
2263
- "is",
2264
- "and",
2265
- "has",
2266
- "have",
2267
- "with",
2268
- "that",
2269
- "which",
2270
- "at",
2271
- "of",
2272
- "same",
2273
- "but",
2274
- "does",
2275
- "still",
2276
- "also"
2277
- ].forEach(function(chain) {
2278
- Assertion.addProperty(chain);
2279
- });
2280
- Assertion.addProperty("not", function() {
2281
- flag2(this, "negate", true);
2282
- });
2283
- Assertion.addProperty("deep", function() {
2284
- flag2(this, "deep", true);
2285
- });
2286
- Assertion.addProperty("nested", function() {
2287
- flag2(this, "nested", true);
2288
- });
2289
- Assertion.addProperty("own", function() {
2290
- flag2(this, "own", true);
2291
- });
2292
- Assertion.addProperty("ordered", function() {
2293
- flag2(this, "ordered", true);
2294
- });
2295
- Assertion.addProperty("any", function() {
2296
- flag2(this, "any", true);
2297
- flag2(this, "all", false);
2298
- });
2299
- Assertion.addProperty("all", function() {
2300
- flag2(this, "all", true);
2301
- flag2(this, "any", false);
2302
- });
2303
- var functionTypes = {
2304
- function: [
2305
- "function",
2306
- "asyncfunction",
2307
- "generatorfunction",
2308
- "asyncgeneratorfunction"
2309
- ],
2310
- asyncfunction: ["asyncfunction", "asyncgeneratorfunction"],
2311
- generatorfunction: ["generatorfunction", "asyncgeneratorfunction"],
2312
- asyncgeneratorfunction: ["asyncgeneratorfunction"]
2313
- };
2314
- function an(type3, msg) {
2315
- if (msg)
2316
- flag2(this, "message", msg);
2317
- type3 = type3.toLowerCase();
2318
- let obj = flag2(this, "object"), article = ~["a", "e", "i", "o", "u"].indexOf(type3.charAt(0)) ? "an " : "a ";
2319
- const detectedType = type(obj).toLowerCase();
2320
- if (functionTypes["function"].includes(type3)) {
2321
- this.assert(
2322
- functionTypes[type3].includes(detectedType),
2323
- "expected #{this} to be " + article + type3,
2324
- "expected #{this} not to be " + article + type3
2325
- );
2326
- } else {
2327
- this.assert(
2328
- type3 === detectedType,
2329
- "expected #{this} to be " + article + type3,
2330
- "expected #{this} not to be " + article + type3
2331
- );
2332
- }
2333
- }
2334
- __name(an, "an");
2335
- Assertion.addChainableMethod("an", an);
2336
- Assertion.addChainableMethod("a", an);
2337
- function SameValueZero(a, b) {
2338
- return isNaN2(a) && isNaN2(b) || a === b;
2339
- }
2340
- __name(SameValueZero, "SameValueZero");
2341
- function includeChainingBehavior() {
2342
- flag2(this, "contains", true);
2343
- }
2344
- __name(includeChainingBehavior, "includeChainingBehavior");
2345
- function include(val, msg) {
2346
- if (msg)
2347
- flag2(this, "message", msg);
2348
- let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), negate = flag2(this, "negate"), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), descriptor = isDeep ? "deep " : "", isEql = isDeep ? flag2(this, "eql") : SameValueZero;
2349
- flagMsg = flagMsg ? flagMsg + ": " : "";
2350
- let included = false;
2351
- switch (objType) {
2352
- case "string":
2353
- included = obj.indexOf(val) !== -1;
2354
- break;
2355
- case "weakset":
2356
- if (isDeep) {
2357
- throw new AssertionError(
2358
- flagMsg + "unable to use .deep.include with WeakSet",
2359
- void 0,
2360
- ssfi
2361
- );
2362
- }
2363
- included = obj.has(val);
2364
- break;
2365
- case "map":
2366
- obj.forEach(function(item) {
2367
- included = included || isEql(item, val);
2368
- });
2369
- break;
2370
- case "set":
2371
- if (isDeep) {
2372
- obj.forEach(function(item) {
2373
- included = included || isEql(item, val);
2374
- });
2375
- } else {
2376
- included = obj.has(val);
2377
- }
2378
- break;
2379
- case "array":
2380
- if (isDeep) {
2381
- included = obj.some(function(item) {
2382
- return isEql(item, val);
2383
- });
2384
- } else {
2385
- included = obj.indexOf(val) !== -1;
2386
- }
2387
- break;
2388
- default: {
2389
- if (val !== Object(val)) {
2390
- throw new AssertionError(
2391
- flagMsg + "the given combination of arguments (" + objType + " and " + type(val).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + type(val).toLowerCase(),
2392
- void 0,
2393
- ssfi
2394
- );
2395
- }
2396
- let props = Object.keys(val);
2397
- let firstErr = null;
2398
- let numErrs = 0;
2399
- props.forEach(function(prop) {
2400
- let propAssertion = new Assertion(obj);
2401
- transferFlags(this, propAssertion, true);
2402
- flag2(propAssertion, "lockSsfi", true);
2403
- if (!negate || props.length === 1) {
2404
- propAssertion.property(prop, val[prop]);
2405
- return;
2406
- }
2407
- try {
2408
- propAssertion.property(prop, val[prop]);
2409
- } catch (err) {
2410
- if (!check_error_exports.compatibleConstructor(err, AssertionError)) {
2411
- throw err;
2412
- }
2413
- if (firstErr === null)
2414
- firstErr = err;
2415
- numErrs++;
2416
- }
2417
- }, this);
2418
- if (negate && props.length > 1 && numErrs === props.length) {
2419
- throw firstErr;
2420
- }
2421
- return;
2422
- }
2423
- }
2424
- this.assert(
2425
- included,
2426
- "expected #{this} to " + descriptor + "include " + inspect2(val),
2427
- "expected #{this} to not " + descriptor + "include " + inspect2(val)
2428
- );
2429
- }
2430
- __name(include, "include");
2431
- Assertion.addChainableMethod("include", include, includeChainingBehavior);
2432
- Assertion.addChainableMethod("contain", include, includeChainingBehavior);
2433
- Assertion.addChainableMethod("contains", include, includeChainingBehavior);
2434
- Assertion.addChainableMethod("includes", include, includeChainingBehavior);
2435
- Assertion.addProperty("ok", function() {
2436
- this.assert(
2437
- flag2(this, "object"),
2438
- "expected #{this} to be truthy",
2439
- "expected #{this} to be falsy"
2440
- );
2441
- });
2442
- Assertion.addProperty("true", function() {
2443
- this.assert(
2444
- true === flag2(this, "object"),
2445
- "expected #{this} to be true",
2446
- "expected #{this} to be false",
2447
- flag2(this, "negate") ? false : true
2448
- );
2449
- });
2450
- Assertion.addProperty("numeric", function() {
2451
- const object = flag2(this, "object");
2452
- this.assert(
2453
- ["Number", "BigInt"].includes(type(object)),
2454
- "expected #{this} to be numeric",
2455
- "expected #{this} to not be numeric",
2456
- flag2(this, "negate") ? false : true
2457
- );
2458
- });
2459
- Assertion.addProperty("callable", function() {
2460
- const val = flag2(this, "object");
2461
- const ssfi = flag2(this, "ssfi");
2462
- const message = flag2(this, "message");
2463
- const msg = message ? `${message}: ` : "";
2464
- const negate = flag2(this, "negate");
2465
- const assertionMessage = negate ? `${msg}expected ${inspect2(val)} not to be a callable function` : `${msg}expected ${inspect2(val)} to be a callable function`;
2466
- const isCallable = [
2467
- "Function",
2468
- "AsyncFunction",
2469
- "GeneratorFunction",
2470
- "AsyncGeneratorFunction"
2471
- ].includes(type(val));
2472
- if (isCallable && negate || !isCallable && !negate) {
2473
- throw new AssertionError(assertionMessage, void 0, ssfi);
2474
- }
2475
- });
2476
- Assertion.addProperty("false", function() {
2477
- this.assert(
2478
- false === flag2(this, "object"),
2479
- "expected #{this} to be false",
2480
- "expected #{this} to be true",
2481
- flag2(this, "negate") ? true : false
2482
- );
2483
- });
2484
- Assertion.addProperty("null", function() {
2485
- this.assert(
2486
- null === flag2(this, "object"),
2487
- "expected #{this} to be null",
2488
- "expected #{this} not to be null"
2489
- );
2490
- });
2491
- Assertion.addProperty("undefined", function() {
2492
- this.assert(
2493
- void 0 === flag2(this, "object"),
2494
- "expected #{this} to be undefined",
2495
- "expected #{this} not to be undefined"
2496
- );
2497
- });
2498
- Assertion.addProperty("NaN", function() {
2499
- this.assert(
2500
- isNaN2(flag2(this, "object")),
2501
- "expected #{this} to be NaN",
2502
- "expected #{this} not to be NaN"
2503
- );
2504
- });
2505
- function assertExist() {
2506
- let val = flag2(this, "object");
2507
- this.assert(
2508
- val !== null && val !== void 0,
2509
- "expected #{this} to exist",
2510
- "expected #{this} to not exist"
2511
- );
2512
- }
2513
- __name(assertExist, "assertExist");
2514
- Assertion.addProperty("exist", assertExist);
2515
- Assertion.addProperty("exists", assertExist);
2516
- Assertion.addProperty("empty", function() {
2517
- let val = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), itemsCount;
2518
- flagMsg = flagMsg ? flagMsg + ": " : "";
2519
- switch (type(val).toLowerCase()) {
2520
- case "array":
2521
- case "string":
2522
- itemsCount = val.length;
2523
- break;
2524
- case "map":
2525
- case "set":
2526
- itemsCount = val.size;
2527
- break;
2528
- case "weakmap":
2529
- case "weakset":
2530
- throw new AssertionError(
2531
- flagMsg + ".empty was passed a weak collection",
2532
- void 0,
2533
- ssfi
2534
- );
2535
- case "function": {
2536
- const msg = flagMsg + ".empty was passed a function " + getName(val);
2537
- throw new AssertionError(msg.trim(), void 0, ssfi);
2538
- }
2539
- default:
2540
- if (val !== Object(val)) {
2541
- throw new AssertionError(
2542
- flagMsg + ".empty was passed non-string primitive " + inspect2(val),
2543
- void 0,
2544
- ssfi
2545
- );
2546
- }
2547
- itemsCount = Object.keys(val).length;
2548
- }
2549
- this.assert(
2550
- 0 === itemsCount,
2551
- "expected #{this} to be empty",
2552
- "expected #{this} not to be empty"
2553
- );
2554
- });
2555
- function checkArguments() {
2556
- let obj = flag2(this, "object"), type3 = type(obj);
2557
- this.assert(
2558
- "Arguments" === type3,
2559
- "expected #{this} to be arguments but got " + type3,
2560
- "expected #{this} to not be arguments"
2561
- );
2562
- }
2563
- __name(checkArguments, "checkArguments");
2564
- Assertion.addProperty("arguments", checkArguments);
2565
- Assertion.addProperty("Arguments", checkArguments);
2566
- function assertEqual(val, msg) {
2567
- if (msg)
2568
- flag2(this, "message", msg);
2569
- let obj = flag2(this, "object");
2570
- if (flag2(this, "deep")) {
2571
- let prevLockSsfi = flag2(this, "lockSsfi");
2572
- flag2(this, "lockSsfi", true);
2573
- this.eql(val);
2574
- flag2(this, "lockSsfi", prevLockSsfi);
2575
- } else {
2576
- this.assert(
2577
- val === obj,
2578
- "expected #{this} to equal #{exp}",
2579
- "expected #{this} to not equal #{exp}",
2580
- val,
2581
- this._obj,
2582
- true
2583
- );
2584
- }
2585
- }
2586
- __name(assertEqual, "assertEqual");
2587
- Assertion.addMethod("equal", assertEqual);
2588
- Assertion.addMethod("equals", assertEqual);
2589
- Assertion.addMethod("eq", assertEqual);
2590
- function assertEql(obj, msg) {
2591
- if (msg)
2592
- flag2(this, "message", msg);
2593
- let eql = flag2(this, "eql");
2594
- this.assert(
2595
- eql(obj, flag2(this, "object")),
2596
- "expected #{this} to deeply equal #{exp}",
2597
- "expected #{this} to not deeply equal #{exp}",
2598
- obj,
2599
- this._obj,
2600
- true
2601
- );
2602
- }
2603
- __name(assertEql, "assertEql");
2604
- Assertion.addMethod("eql", assertEql);
2605
- Assertion.addMethod("eqls", assertEql);
2606
- function assertAbove(n, msg) {
2607
- if (msg)
2608
- flag2(this, "message", msg);
2609
- let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase();
2610
- if (doLength && objType !== "map" && objType !== "set") {
2611
- new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
2612
- }
2613
- if (!doLength && objType === "date" && nType !== "date") {
2614
- throw new AssertionError(
2615
- msgPrefix + "the argument to above must be a date",
2616
- void 0,
2617
- ssfi
2618
- );
2619
- } else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
2620
- throw new AssertionError(
2621
- msgPrefix + "the argument to above must be a number",
2622
- void 0,
2623
- ssfi
2624
- );
2625
- } else if (!doLength && objType !== "date" && !isNumeric(obj)) {
2626
- let printObj = objType === "string" ? "'" + obj + "'" : obj;
2627
- throw new AssertionError(
2628
- msgPrefix + "expected " + printObj + " to be a number or a date",
2629
- void 0,
2630
- ssfi
2631
- );
2632
- }
2633
- if (doLength) {
2634
- let descriptor = "length", itemsCount;
2635
- if (objType === "map" || objType === "set") {
2636
- descriptor = "size";
2637
- itemsCount = obj.size;
2638
- } else {
2639
- itemsCount = obj.length;
2640
- }
2641
- this.assert(
2642
- itemsCount > n,
2643
- "expected #{this} to have a " + descriptor + " above #{exp} but got #{act}",
2644
- "expected #{this} to not have a " + descriptor + " above #{exp}",
2645
- n,
2646
- itemsCount
2647
- );
2648
- } else {
2649
- this.assert(
2650
- obj > n,
2651
- "expected #{this} to be above #{exp}",
2652
- "expected #{this} to be at most #{exp}",
2653
- n
2654
- );
2655
- }
2656
- }
2657
- __name(assertAbove, "assertAbove");
2658
- Assertion.addMethod("above", assertAbove);
2659
- Assertion.addMethod("gt", assertAbove);
2660
- Assertion.addMethod("greaterThan", assertAbove);
2661
- function assertLeast(n, msg) {
2662
- if (msg)
2663
- flag2(this, "message", msg);
2664
- let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
2665
- if (doLength && objType !== "map" && objType !== "set") {
2666
- new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
2667
- }
2668
- if (!doLength && objType === "date" && nType !== "date") {
2669
- errorMessage = msgPrefix + "the argument to least must be a date";
2670
- } else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
2671
- errorMessage = msgPrefix + "the argument to least must be a number";
2672
- } else if (!doLength && objType !== "date" && !isNumeric(obj)) {
2673
- let printObj = objType === "string" ? "'" + obj + "'" : obj;
2674
- errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
2675
- } else {
2676
- shouldThrow = false;
2677
- }
2678
- if (shouldThrow) {
2679
- throw new AssertionError(errorMessage, void 0, ssfi);
2680
- }
2681
- if (doLength) {
2682
- let descriptor = "length", itemsCount;
2683
- if (objType === "map" || objType === "set") {
2684
- descriptor = "size";
2685
- itemsCount = obj.size;
2686
- } else {
2687
- itemsCount = obj.length;
2688
- }
2689
- this.assert(
2690
- itemsCount >= n,
2691
- "expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}",
2692
- "expected #{this} to have a " + descriptor + " below #{exp}",
2693
- n,
2694
- itemsCount
2695
- );
2696
- } else {
2697
- this.assert(
2698
- obj >= n,
2699
- "expected #{this} to be at least #{exp}",
2700
- "expected #{this} to be below #{exp}",
2701
- n
2702
- );
2703
- }
2704
- }
2705
- __name(assertLeast, "assertLeast");
2706
- Assertion.addMethod("least", assertLeast);
2707
- Assertion.addMethod("gte", assertLeast);
2708
- Assertion.addMethod("greaterThanOrEqual", assertLeast);
2709
- function assertBelow(n, msg) {
2710
- if (msg)
2711
- flag2(this, "message", msg);
2712
- let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
2713
- if (doLength && objType !== "map" && objType !== "set") {
2714
- new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
2715
- }
2716
- if (!doLength && objType === "date" && nType !== "date") {
2717
- errorMessage = msgPrefix + "the argument to below must be a date";
2718
- } else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
2719
- errorMessage = msgPrefix + "the argument to below must be a number";
2720
- } else if (!doLength && objType !== "date" && !isNumeric(obj)) {
2721
- let printObj = objType === "string" ? "'" + obj + "'" : obj;
2722
- errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
2723
- } else {
2724
- shouldThrow = false;
2725
- }
2726
- if (shouldThrow) {
2727
- throw new AssertionError(errorMessage, void 0, ssfi);
2728
- }
2729
- if (doLength) {
2730
- let descriptor = "length", itemsCount;
2731
- if (objType === "map" || objType === "set") {
2732
- descriptor = "size";
2733
- itemsCount = obj.size;
2734
- } else {
2735
- itemsCount = obj.length;
2736
- }
2737
- this.assert(
2738
- itemsCount < n,
2739
- "expected #{this} to have a " + descriptor + " below #{exp} but got #{act}",
2740
- "expected #{this} to not have a " + descriptor + " below #{exp}",
2741
- n,
2742
- itemsCount
2743
- );
2744
- } else {
2745
- this.assert(
2746
- obj < n,
2747
- "expected #{this} to be below #{exp}",
2748
- "expected #{this} to be at least #{exp}",
2749
- n
2750
- );
2751
- }
2752
- }
2753
- __name(assertBelow, "assertBelow");
2754
- Assertion.addMethod("below", assertBelow);
2755
- Assertion.addMethod("lt", assertBelow);
2756
- Assertion.addMethod("lessThan", assertBelow);
2757
- function assertMost(n, msg) {
2758
- if (msg)
2759
- flag2(this, "message", msg);
2760
- let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
2761
- if (doLength && objType !== "map" && objType !== "set") {
2762
- new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
2763
- }
2764
- if (!doLength && objType === "date" && nType !== "date") {
2765
- errorMessage = msgPrefix + "the argument to most must be a date";
2766
- } else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
2767
- errorMessage = msgPrefix + "the argument to most must be a number";
2768
- } else if (!doLength && objType !== "date" && !isNumeric(obj)) {
2769
- let printObj = objType === "string" ? "'" + obj + "'" : obj;
2770
- errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
2771
- } else {
2772
- shouldThrow = false;
2773
- }
2774
- if (shouldThrow) {
2775
- throw new AssertionError(errorMessage, void 0, ssfi);
2776
- }
2777
- if (doLength) {
2778
- let descriptor = "length", itemsCount;
2779
- if (objType === "map" || objType === "set") {
2780
- descriptor = "size";
2781
- itemsCount = obj.size;
2782
- } else {
2783
- itemsCount = obj.length;
2784
- }
2785
- this.assert(
2786
- itemsCount <= n,
2787
- "expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}",
2788
- "expected #{this} to have a " + descriptor + " above #{exp}",
2789
- n,
2790
- itemsCount
2791
- );
2792
- } else {
2793
- this.assert(
2794
- obj <= n,
2795
- "expected #{this} to be at most #{exp}",
2796
- "expected #{this} to be above #{exp}",
2797
- n
2798
- );
2799
- }
2800
- }
2801
- __name(assertMost, "assertMost");
2802
- Assertion.addMethod("most", assertMost);
2803
- Assertion.addMethod("lte", assertMost);
2804
- Assertion.addMethod("lessThanOrEqual", assertMost);
2805
- Assertion.addMethod("within", function(start, finish, msg) {
2806
- if (msg)
2807
- flag2(this, "message", msg);
2808
- let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), startType = type(start).toLowerCase(), finishType = type(finish).toLowerCase(), errorMessage, shouldThrow = true, range = startType === "date" && finishType === "date" ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish;
2809
- if (doLength && objType !== "map" && objType !== "set") {
2810
- new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
2811
- }
2812
- if (!doLength && objType === "date" && (startType !== "date" || finishType !== "date")) {
2813
- errorMessage = msgPrefix + "the arguments to within must be dates";
2814
- } else if ((!isNumeric(start) || !isNumeric(finish)) && (doLength || isNumeric(obj))) {
2815
- errorMessage = msgPrefix + "the arguments to within must be numbers";
2816
- } else if (!doLength && objType !== "date" && !isNumeric(obj)) {
2817
- let printObj = objType === "string" ? "'" + obj + "'" : obj;
2818
- errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
2819
- } else {
2820
- shouldThrow = false;
2821
- }
2822
- if (shouldThrow) {
2823
- throw new AssertionError(errorMessage, void 0, ssfi);
2824
- }
2825
- if (doLength) {
2826
- let descriptor = "length", itemsCount;
2827
- if (objType === "map" || objType === "set") {
2828
- descriptor = "size";
2829
- itemsCount = obj.size;
2830
- } else {
2831
- itemsCount = obj.length;
2832
- }
2833
- this.assert(
2834
- itemsCount >= start && itemsCount <= finish,
2835
- "expected #{this} to have a " + descriptor + " within " + range,
2836
- "expected #{this} to not have a " + descriptor + " within " + range
2837
- );
2838
- } else {
2839
- this.assert(
2840
- obj >= start && obj <= finish,
2841
- "expected #{this} to be within " + range,
2842
- "expected #{this} to not be within " + range
2843
- );
2844
- }
2845
- });
2846
- function assertInstanceOf(constructor, msg) {
2847
- if (msg)
2848
- flag2(this, "message", msg);
2849
- let target = flag2(this, "object");
2850
- let ssfi = flag2(this, "ssfi");
2851
- let flagMsg = flag2(this, "message");
2852
- let isInstanceOf;
2853
- try {
2854
- isInstanceOf = target instanceof constructor;
2855
- } catch (err) {
2856
- if (err instanceof TypeError) {
2857
- flagMsg = flagMsg ? flagMsg + ": " : "";
2858
- throw new AssertionError(
2859
- flagMsg + "The instanceof assertion needs a constructor but " + type(constructor) + " was given.",
2860
- void 0,
2861
- ssfi
2862
- );
2863
- }
2864
- throw err;
2865
- }
2866
- let name = getName(constructor);
2867
- if (name == null) {
2868
- name = "an unnamed constructor";
2869
- }
2870
- this.assert(
2871
- isInstanceOf,
2872
- "expected #{this} to be an instance of " + name,
2873
- "expected #{this} to not be an instance of " + name
2874
- );
2875
- }
2876
- __name(assertInstanceOf, "assertInstanceOf");
2877
- Assertion.addMethod("instanceof", assertInstanceOf);
2878
- Assertion.addMethod("instanceOf", assertInstanceOf);
2879
- function assertProperty(name, val, msg) {
2880
- if (msg)
2881
- flag2(this, "message", msg);
2882
- let isNested = flag2(this, "nested"), isOwn = flag2(this, "own"), flagMsg = flag2(this, "message"), obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), nameType = typeof name;
2883
- flagMsg = flagMsg ? flagMsg + ": " : "";
2884
- if (isNested) {
2885
- if (nameType !== "string") {
2886
- throw new AssertionError(
2887
- flagMsg + "the argument to property must be a string when using nested syntax",
2888
- void 0,
2889
- ssfi
2890
- );
2891
- }
2892
- } else {
2893
- if (nameType !== "string" && nameType !== "number" && nameType !== "symbol") {
2894
- throw new AssertionError(
2895
- flagMsg + "the argument to property must be a string, number, or symbol",
2896
- void 0,
2897
- ssfi
2898
- );
2899
- }
2900
- }
2901
- if (isNested && isOwn) {
2902
- throw new AssertionError(
2903
- flagMsg + 'The "nested" and "own" flags cannot be combined.',
2904
- void 0,
2905
- ssfi
2906
- );
2907
- }
2908
- if (obj === null || obj === void 0) {
2909
- throw new AssertionError(
2910
- flagMsg + "Target cannot be null or undefined.",
2911
- void 0,
2912
- ssfi
2913
- );
2914
- }
2915
- let isDeep = flag2(this, "deep"), negate = flag2(this, "negate"), pathInfo = isNested ? getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name], isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
2916
- let descriptor = "";
2917
- if (isDeep)
2918
- descriptor += "deep ";
2919
- if (isOwn)
2920
- descriptor += "own ";
2921
- if (isNested)
2922
- descriptor += "nested ";
2923
- descriptor += "property ";
2924
- let hasProperty2;
2925
- if (isOwn)
2926
- hasProperty2 = Object.prototype.hasOwnProperty.call(obj, name);
2927
- else if (isNested)
2928
- hasProperty2 = pathInfo.exists;
2929
- else
2930
- hasProperty2 = hasProperty(obj, name);
2931
- if (!negate || arguments.length === 1) {
2932
- this.assert(
2933
- hasProperty2,
2934
- "expected #{this} to have " + descriptor + inspect2(name),
2935
- "expected #{this} to not have " + descriptor + inspect2(name)
2936
- );
2937
- }
2938
- if (arguments.length > 1) {
2939
- this.assert(
2940
- hasProperty2 && isEql(val, value),
2941
- "expected #{this} to have " + descriptor + inspect2(name) + " of #{exp}, but got #{act}",
2942
- "expected #{this} to not have " + descriptor + inspect2(name) + " of #{act}",
2943
- val,
2944
- value
2945
- );
2946
- }
2947
- flag2(this, "object", value);
2948
- }
2949
- __name(assertProperty, "assertProperty");
2950
- Assertion.addMethod("property", assertProperty);
2951
- function assertOwnProperty(_name, _value, _msg) {
2952
- flag2(this, "own", true);
2953
- assertProperty.apply(this, arguments);
2954
- }
2955
- __name(assertOwnProperty, "assertOwnProperty");
2956
- Assertion.addMethod("ownProperty", assertOwnProperty);
2957
- Assertion.addMethod("haveOwnProperty", assertOwnProperty);
2958
- function assertOwnPropertyDescriptor(name, descriptor, msg) {
2959
- if (typeof descriptor === "string") {
2960
- msg = descriptor;
2961
- descriptor = null;
2962
- }
2963
- if (msg)
2964
- flag2(this, "message", msg);
2965
- let obj = flag2(this, "object");
2966
- let actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
2967
- let eql = flag2(this, "eql");
2968
- if (actualDescriptor && descriptor) {
2969
- this.assert(
2970
- eql(descriptor, actualDescriptor),
2971
- "expected the own property descriptor for " + inspect2(name) + " on #{this} to match " + inspect2(descriptor) + ", got " + inspect2(actualDescriptor),
2972
- "expected the own property descriptor for " + inspect2(name) + " on #{this} to not match " + inspect2(descriptor),
2973
- descriptor,
2974
- actualDescriptor,
2975
- true
2976
- );
2977
- } else {
2978
- this.assert(
2979
- actualDescriptor,
2980
- "expected #{this} to have an own property descriptor for " + inspect2(name),
2981
- "expected #{this} to not have an own property descriptor for " + inspect2(name)
2982
- );
2983
- }
2984
- flag2(this, "object", actualDescriptor);
2985
- }
2986
- __name(assertOwnPropertyDescriptor, "assertOwnPropertyDescriptor");
2987
- Assertion.addMethod("ownPropertyDescriptor", assertOwnPropertyDescriptor);
2988
- Assertion.addMethod("haveOwnPropertyDescriptor", assertOwnPropertyDescriptor);
2989
- function assertLengthChain() {
2990
- flag2(this, "doLength", true);
2991
- }
2992
- __name(assertLengthChain, "assertLengthChain");
2993
- function assertLength(n, msg) {
2994
- if (msg)
2995
- flag2(this, "message", msg);
2996
- let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), descriptor = "length", itemsCount;
2997
- switch (objType) {
2998
- case "map":
2999
- case "set":
3000
- descriptor = "size";
3001
- itemsCount = obj.size;
3002
- break;
3003
- default:
3004
- new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
3005
- itemsCount = obj.length;
3006
- }
3007
- this.assert(
3008
- itemsCount == n,
3009
- "expected #{this} to have a " + descriptor + " of #{exp} but got #{act}",
3010
- "expected #{this} to not have a " + descriptor + " of #{act}",
3011
- n,
3012
- itemsCount
3013
- );
3014
- }
3015
- __name(assertLength, "assertLength");
3016
- Assertion.addChainableMethod("length", assertLength, assertLengthChain);
3017
- Assertion.addChainableMethod("lengthOf", assertLength, assertLengthChain);
3018
- function assertMatch(re, msg) {
3019
- if (msg)
3020
- flag2(this, "message", msg);
3021
- let obj = flag2(this, "object");
3022
- this.assert(
3023
- re.exec(obj),
3024
- "expected #{this} to match " + re,
3025
- "expected #{this} not to match " + re
3026
- );
3027
- }
3028
- __name(assertMatch, "assertMatch");
3029
- Assertion.addMethod("match", assertMatch);
3030
- Assertion.addMethod("matches", assertMatch);
3031
- Assertion.addMethod("string", function(str, msg) {
3032
- if (msg)
3033
- flag2(this, "message", msg);
3034
- let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
3035
- new Assertion(obj, flagMsg, ssfi, true).is.a("string");
3036
- this.assert(
3037
- ~obj.indexOf(str),
3038
- "expected #{this} to contain " + inspect2(str),
3039
- "expected #{this} to not contain " + inspect2(str)
3040
- );
3041
- });
3042
- function assertKeys(keys) {
3043
- let obj = flag2(this, "object"), objType = type(obj), keysType = type(keys), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = flag2(this, "message");
3044
- flagMsg = flagMsg ? flagMsg + ": " : "";
3045
- let mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
3046
- if (objType === "Map" || objType === "Set") {
3047
- deepStr = isDeep ? "deeply " : "";
3048
- actual = [];
3049
- obj.forEach(function(val, key) {
3050
- actual.push(key);
3051
- });
3052
- if (keysType !== "Array") {
3053
- keys = Array.prototype.slice.call(arguments);
3054
- }
3055
- } else {
3056
- actual = getOwnEnumerableProperties(obj);
3057
- switch (keysType) {
3058
- case "Array":
3059
- if (arguments.length > 1) {
3060
- throw new AssertionError(mixedArgsMsg, void 0, ssfi);
3061
- }
3062
- break;
3063
- case "Object":
3064
- if (arguments.length > 1) {
3065
- throw new AssertionError(mixedArgsMsg, void 0, ssfi);
3066
- }
3067
- keys = Object.keys(keys);
3068
- break;
3069
- default:
3070
- keys = Array.prototype.slice.call(arguments);
3071
- }
3072
- keys = keys.map(function(val) {
3073
- return typeof val === "symbol" ? val : String(val);
3074
- });
3075
- }
3076
- if (!keys.length) {
3077
- throw new AssertionError(flagMsg + "keys required", void 0, ssfi);
3078
- }
3079
- let len = keys.length, any = flag2(this, "any"), all = flag2(this, "all"), expected = keys, isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
3080
- if (!any && !all) {
3081
- all = true;
3082
- }
3083
- if (any) {
3084
- ok = expected.some(function(expectedKey) {
3085
- return actual.some(function(actualKey) {
3086
- return isEql(expectedKey, actualKey);
3087
- });
3088
- });
3089
- }
3090
- if (all) {
3091
- ok = expected.every(function(expectedKey) {
3092
- return actual.some(function(actualKey) {
3093
- return isEql(expectedKey, actualKey);
3094
- });
3095
- });
3096
- if (!flag2(this, "contains")) {
3097
- ok = ok && keys.length == actual.length;
3098
- }
3099
- }
3100
- if (len > 1) {
3101
- keys = keys.map(function(key) {
3102
- return inspect2(key);
3103
- });
3104
- let last = keys.pop();
3105
- if (all) {
3106
- str = keys.join(", ") + ", and " + last;
3107
- }
3108
- if (any) {
3109
- str = keys.join(", ") + ", or " + last;
3110
- }
3111
- } else {
3112
- str = inspect2(keys[0]);
3113
- }
3114
- str = (len > 1 ? "keys " : "key ") + str;
3115
- str = (flag2(this, "contains") ? "contain " : "have ") + str;
3116
- this.assert(
3117
- ok,
3118
- "expected #{this} to " + deepStr + str,
3119
- "expected #{this} to not " + deepStr + str,
3120
- expected.slice(0).sort(compareByInspect),
3121
- actual.sort(compareByInspect),
3122
- true
3123
- );
3124
- }
3125
- __name(assertKeys, "assertKeys");
3126
- Assertion.addMethod("keys", assertKeys);
3127
- Assertion.addMethod("key", assertKeys);
3128
- function assertThrows(errorLike, errMsgMatcher, msg) {
3129
- if (msg)
3130
- flag2(this, "message", msg);
3131
- let obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), negate = flag2(this, "negate") || false;
3132
- new Assertion(obj, flagMsg, ssfi, true).is.a("function");
3133
- if (isRegExp2(errorLike) || typeof errorLike === "string") {
3134
- errMsgMatcher = errorLike;
3135
- errorLike = null;
3136
- }
3137
- let caughtErr;
3138
- let errorWasThrown = false;
3139
- try {
3140
- obj();
3141
- } catch (err) {
3142
- errorWasThrown = true;
3143
- caughtErr = err;
3144
- }
3145
- let everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0;
3146
- let everyArgIsDefined = Boolean(errorLike && errMsgMatcher);
3147
- let errorLikeFail = false;
3148
- let errMsgMatcherFail = false;
3149
- if (everyArgIsUndefined || !everyArgIsUndefined && !negate) {
3150
- let errorLikeString = "an error";
3151
- if (errorLike instanceof Error) {
3152
- errorLikeString = "#{exp}";
3153
- } else if (errorLike) {
3154
- errorLikeString = check_error_exports.getConstructorName(errorLike);
3155
- }
3156
- let actual = caughtErr;
3157
- if (caughtErr instanceof Error) {
3158
- actual = caughtErr.toString();
3159
- } else if (typeof caughtErr === "string") {
3160
- actual = caughtErr;
3161
- } else if (caughtErr && (typeof caughtErr === "object" || typeof caughtErr === "function")) {
3162
- try {
3163
- actual = check_error_exports.getConstructorName(caughtErr);
3164
- } catch (_err) {
3165
- }
3166
- }
3167
- this.assert(
3168
- errorWasThrown,
3169
- "expected #{this} to throw " + errorLikeString,
3170
- "expected #{this} to not throw an error but #{act} was thrown",
3171
- errorLike && errorLike.toString(),
3172
- actual
3173
- );
3174
- }
3175
- if (errorLike && caughtErr) {
3176
- if (errorLike instanceof Error) {
3177
- let isCompatibleInstance = check_error_exports.compatibleInstance(
3178
- caughtErr,
3179
- errorLike
3180
- );
3181
- if (isCompatibleInstance === negate) {
3182
- if (everyArgIsDefined && negate) {
3183
- errorLikeFail = true;
3184
- } else {
3185
- this.assert(
3186
- negate,
3187
- "expected #{this} to throw #{exp} but #{act} was thrown",
3188
- "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""),
3189
- errorLike.toString(),
3190
- caughtErr.toString()
3191
- );
3192
- }
3193
- }
3194
- }
3195
- let isCompatibleConstructor = check_error_exports.compatibleConstructor(
3196
- caughtErr,
3197
- errorLike
3198
- );
3199
- if (isCompatibleConstructor === negate) {
3200
- if (everyArgIsDefined && negate) {
3201
- errorLikeFail = true;
3202
- } else {
3203
- this.assert(
3204
- negate,
3205
- "expected #{this} to throw #{exp} but #{act} was thrown",
3206
- "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""),
3207
- errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike),
3208
- caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr)
3209
- );
3210
- }
3211
- }
3212
- }
3213
- if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) {
3214
- let placeholder = "including";
3215
- if (isRegExp2(errMsgMatcher)) {
3216
- placeholder = "matching";
3217
- }
3218
- let isCompatibleMessage = check_error_exports.compatibleMessage(
3219
- caughtErr,
3220
- errMsgMatcher
3221
- );
3222
- if (isCompatibleMessage === negate) {
3223
- if (everyArgIsDefined && negate) {
3224
- errMsgMatcherFail = true;
3225
- } else {
3226
- this.assert(
3227
- negate,
3228
- "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}",
3229
- "expected #{this} to throw error not " + placeholder + " #{exp}",
3230
- errMsgMatcher,
3231
- check_error_exports.getMessage(caughtErr)
3232
- );
3233
- }
3234
- }
3235
- }
3236
- if (errorLikeFail && errMsgMatcherFail) {
3237
- this.assert(
3238
- negate,
3239
- "expected #{this} to throw #{exp} but #{act} was thrown",
3240
- "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""),
3241
- errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike),
3242
- caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr)
3243
- );
3244
- }
3245
- flag2(this, "object", caughtErr);
3246
- }
3247
- __name(assertThrows, "assertThrows");
3248
- Assertion.addMethod("throw", assertThrows);
3249
- Assertion.addMethod("throws", assertThrows);
3250
- Assertion.addMethod("Throw", assertThrows);
3251
- function respondTo(method, msg) {
3252
- if (msg)
3253
- flag2(this, "message", msg);
3254
- let obj = flag2(this, "object"), itself = flag2(this, "itself"), context = "function" === typeof obj && !itself ? obj.prototype[method] : obj[method];
3255
- this.assert(
3256
- "function" === typeof context,
3257
- "expected #{this} to respond to " + inspect2(method),
3258
- "expected #{this} to not respond to " + inspect2(method)
3259
- );
3260
- }
3261
- __name(respondTo, "respondTo");
3262
- Assertion.addMethod("respondTo", respondTo);
3263
- Assertion.addMethod("respondsTo", respondTo);
3264
- Assertion.addProperty("itself", function() {
3265
- flag2(this, "itself", true);
3266
- });
3267
- function satisfy(matcher, msg) {
3268
- if (msg)
3269
- flag2(this, "message", msg);
3270
- let obj = flag2(this, "object");
3271
- let result = matcher(obj);
3272
- this.assert(
3273
- result,
3274
- "expected #{this} to satisfy " + objDisplay(matcher),
3275
- "expected #{this} to not satisfy" + objDisplay(matcher),
3276
- flag2(this, "negate") ? false : true,
3277
- result
3278
- );
3279
- }
3280
- __name(satisfy, "satisfy");
3281
- Assertion.addMethod("satisfy", satisfy);
3282
- Assertion.addMethod("satisfies", satisfy);
3283
- function closeTo(expected, delta, msg) {
3284
- if (msg)
3285
- flag2(this, "message", msg);
3286
- let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
3287
- new Assertion(obj, flagMsg, ssfi, true).is.numeric;
3288
- let message = "A `delta` value is required for `closeTo`";
3289
- if (delta == void 0) {
3290
- throw new AssertionError(
3291
- flagMsg ? `${flagMsg}: ${message}` : message,
3292
- void 0,
3293
- ssfi
3294
- );
3295
- }
3296
- new Assertion(delta, flagMsg, ssfi, true).is.numeric;
3297
- message = "A `expected` value is required for `closeTo`";
3298
- if (expected == void 0) {
3299
- throw new AssertionError(
3300
- flagMsg ? `${flagMsg}: ${message}` : message,
3301
- void 0,
3302
- ssfi
3303
- );
3304
- }
3305
- new Assertion(expected, flagMsg, ssfi, true).is.numeric;
3306
- const abs = /* @__PURE__ */ __name((x) => x < 0n ? -x : x, "abs");
3307
- const strip = /* @__PURE__ */ __name((number) => parseFloat(parseFloat(number).toPrecision(12)), "strip");
3308
- this.assert(
3309
- strip(abs(obj - expected)) <= delta,
3310
- "expected #{this} to be close to " + expected + " +/- " + delta,
3311
- "expected #{this} not to be close to " + expected + " +/- " + delta
3312
- );
3313
- }
3314
- __name(closeTo, "closeTo");
3315
- Assertion.addMethod("closeTo", closeTo);
3316
- Assertion.addMethod("approximately", closeTo);
3317
- function isSubsetOf(_subset, _superset, cmp, contains, ordered) {
3318
- let superset = Array.from(_superset);
3319
- let subset = Array.from(_subset);
3320
- if (!contains) {
3321
- if (subset.length !== superset.length)
3322
- return false;
3323
- superset = superset.slice();
3324
- }
3325
- return subset.every(function(elem, idx) {
3326
- if (ordered)
3327
- return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];
3328
- if (!cmp) {
3329
- let matchIdx = superset.indexOf(elem);
3330
- if (matchIdx === -1)
3331
- return false;
3332
- if (!contains)
3333
- superset.splice(matchIdx, 1);
3334
- return true;
3335
- }
3336
- return superset.some(function(elem2, matchIdx) {
3337
- if (!cmp(elem, elem2))
3338
- return false;
3339
- if (!contains)
3340
- superset.splice(matchIdx, 1);
3341
- return true;
3342
- });
3343
- });
3344
- }
3345
- __name(isSubsetOf, "isSubsetOf");
3346
- Assertion.addMethod("members", function(subset, msg) {
3347
- if (msg)
3348
- flag2(this, "message", msg);
3349
- let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
3350
- new Assertion(obj, flagMsg, ssfi, true).to.be.iterable;
3351
- new Assertion(subset, flagMsg, ssfi, true).to.be.iterable;
3352
- let contains = flag2(this, "contains");
3353
- let ordered = flag2(this, "ordered");
3354
- let subject, failMsg, failNegateMsg;
3355
- if (contains) {
3356
- subject = ordered ? "an ordered superset" : "a superset";
3357
- failMsg = "expected #{this} to be " + subject + " of #{exp}";
3358
- failNegateMsg = "expected #{this} to not be " + subject + " of #{exp}";
3359
- } else {
3360
- subject = ordered ? "ordered members" : "members";
3361
- failMsg = "expected #{this} to have the same " + subject + " as #{exp}";
3362
- failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}";
3363
- }
3364
- let cmp = flag2(this, "deep") ? flag2(this, "eql") : void 0;
3365
- this.assert(
3366
- isSubsetOf(subset, obj, cmp, contains, ordered),
3367
- failMsg,
3368
- failNegateMsg,
3369
- subset,
3370
- obj,
3371
- true
3372
- );
3373
- });
3374
- Assertion.addProperty("iterable", function(msg) {
3375
- if (msg)
3376
- flag2(this, "message", msg);
3377
- let obj = flag2(this, "object");
3378
- this.assert(
3379
- obj != void 0 && obj[Symbol.iterator],
3380
- "expected #{this} to be an iterable",
3381
- "expected #{this} to not be an iterable",
3382
- obj
3383
- );
3384
- });
3385
- function oneOf(list, msg) {
3386
- if (msg)
3387
- flag2(this, "message", msg);
3388
- let expected = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), contains = flag2(this, "contains"), isDeep = flag2(this, "deep"), eql = flag2(this, "eql");
3389
- new Assertion(list, flagMsg, ssfi, true).to.be.an("array");
3390
- if (contains) {
3391
- this.assert(
3392
- list.some(function(possibility) {
3393
- return expected.indexOf(possibility) > -1;
3394
- }),
3395
- "expected #{this} to contain one of #{exp}",
3396
- "expected #{this} to not contain one of #{exp}",
3397
- list,
3398
- expected
3399
- );
3400
- } else {
3401
- if (isDeep) {
3402
- this.assert(
3403
- list.some(function(possibility) {
3404
- return eql(expected, possibility);
3405
- }),
3406
- "expected #{this} to deeply equal one of #{exp}",
3407
- "expected #{this} to deeply equal one of #{exp}",
3408
- list,
3409
- expected
3410
- );
3411
- } else {
3412
- this.assert(
3413
- list.indexOf(expected) > -1,
3414
- "expected #{this} to be one of #{exp}",
3415
- "expected #{this} to not be one of #{exp}",
3416
- list,
3417
- expected
3418
- );
3419
- }
3420
- }
3421
- }
3422
- __name(oneOf, "oneOf");
3423
- Assertion.addMethod("oneOf", oneOf);
3424
- function assertChanges(subject, prop, msg) {
3425
- if (msg)
3426
- flag2(this, "message", msg);
3427
- let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
3428
- new Assertion(fn, flagMsg, ssfi, true).is.a("function");
3429
- let initial;
3430
- if (!prop) {
3431
- new Assertion(subject, flagMsg, ssfi, true).is.a("function");
3432
- initial = subject();
3433
- } else {
3434
- new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
3435
- initial = subject[prop];
3436
- }
3437
- fn();
3438
- let final = prop === void 0 || prop === null ? subject() : subject[prop];
3439
- let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
3440
- flag2(this, "deltaMsgObj", msgObj);
3441
- flag2(this, "initialDeltaValue", initial);
3442
- flag2(this, "finalDeltaValue", final);
3443
- flag2(this, "deltaBehavior", "change");
3444
- flag2(this, "realDelta", final !== initial);
3445
- this.assert(
3446
- initial !== final,
3447
- "expected " + msgObj + " to change",
3448
- "expected " + msgObj + " to not change"
3449
- );
3450
- }
3451
- __name(assertChanges, "assertChanges");
3452
- Assertion.addMethod("change", assertChanges);
3453
- Assertion.addMethod("changes", assertChanges);
3454
- function assertIncreases(subject, prop, msg) {
3455
- if (msg)
3456
- flag2(this, "message", msg);
3457
- let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
3458
- new Assertion(fn, flagMsg, ssfi, true).is.a("function");
3459
- let initial;
3460
- if (!prop) {
3461
- new Assertion(subject, flagMsg, ssfi, true).is.a("function");
3462
- initial = subject();
3463
- } else {
3464
- new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
3465
- initial = subject[prop];
3466
- }
3467
- new Assertion(initial, flagMsg, ssfi, true).is.a("number");
3468
- fn();
3469
- let final = prop === void 0 || prop === null ? subject() : subject[prop];
3470
- let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
3471
- flag2(this, "deltaMsgObj", msgObj);
3472
- flag2(this, "initialDeltaValue", initial);
3473
- flag2(this, "finalDeltaValue", final);
3474
- flag2(this, "deltaBehavior", "increase");
3475
- flag2(this, "realDelta", final - initial);
3476
- this.assert(
3477
- final - initial > 0,
3478
- "expected " + msgObj + " to increase",
3479
- "expected " + msgObj + " to not increase"
3480
- );
3481
- }
3482
- __name(assertIncreases, "assertIncreases");
3483
- Assertion.addMethod("increase", assertIncreases);
3484
- Assertion.addMethod("increases", assertIncreases);
3485
- function assertDecreases(subject, prop, msg) {
3486
- if (msg)
3487
- flag2(this, "message", msg);
3488
- let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
3489
- new Assertion(fn, flagMsg, ssfi, true).is.a("function");
3490
- let initial;
3491
- if (!prop) {
3492
- new Assertion(subject, flagMsg, ssfi, true).is.a("function");
3493
- initial = subject();
3494
- } else {
3495
- new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
3496
- initial = subject[prop];
3497
- }
3498
- new Assertion(initial, flagMsg, ssfi, true).is.a("number");
3499
- fn();
3500
- let final = prop === void 0 || prop === null ? subject() : subject[prop];
3501
- let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
3502
- flag2(this, "deltaMsgObj", msgObj);
3503
- flag2(this, "initialDeltaValue", initial);
3504
- flag2(this, "finalDeltaValue", final);
3505
- flag2(this, "deltaBehavior", "decrease");
3506
- flag2(this, "realDelta", initial - final);
3507
- this.assert(
3508
- final - initial < 0,
3509
- "expected " + msgObj + " to decrease",
3510
- "expected " + msgObj + " to not decrease"
3511
- );
3512
- }
3513
- __name(assertDecreases, "assertDecreases");
3514
- Assertion.addMethod("decrease", assertDecreases);
3515
- Assertion.addMethod("decreases", assertDecreases);
3516
- function assertDelta(delta, msg) {
3517
- if (msg)
3518
- flag2(this, "message", msg);
3519
- let msgObj = flag2(this, "deltaMsgObj");
3520
- let initial = flag2(this, "initialDeltaValue");
3521
- let final = flag2(this, "finalDeltaValue");
3522
- let behavior = flag2(this, "deltaBehavior");
3523
- let realDelta = flag2(this, "realDelta");
3524
- let expression;
3525
- if (behavior === "change") {
3526
- expression = Math.abs(final - initial) === Math.abs(delta);
3527
- } else {
3528
- expression = realDelta === Math.abs(delta);
3529
- }
3530
- this.assert(
3531
- expression,
3532
- "expected " + msgObj + " to " + behavior + " by " + delta,
3533
- "expected " + msgObj + " to not " + behavior + " by " + delta
3534
- );
3535
- }
3536
- __name(assertDelta, "assertDelta");
3537
- Assertion.addMethod("by", assertDelta);
3538
- Assertion.addProperty("extensible", function() {
3539
- let obj = flag2(this, "object");
3540
- let isExtensible = obj === Object(obj) && Object.isExtensible(obj);
3541
- this.assert(
3542
- isExtensible,
3543
- "expected #{this} to be extensible",
3544
- "expected #{this} to not be extensible"
3545
- );
3546
- });
3547
- Assertion.addProperty("sealed", function() {
3548
- let obj = flag2(this, "object");
3549
- let isSealed = obj === Object(obj) ? Object.isSealed(obj) : true;
3550
- this.assert(
3551
- isSealed,
3552
- "expected #{this} to be sealed",
3553
- "expected #{this} to not be sealed"
3554
- );
3555
- });
3556
- Assertion.addProperty("frozen", function() {
3557
- let obj = flag2(this, "object");
3558
- let isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true;
3559
- this.assert(
3560
- isFrozen,
3561
- "expected #{this} to be frozen",
3562
- "expected #{this} to not be frozen"
3563
- );
3564
- });
3565
- Assertion.addProperty("finite", function(_msg) {
3566
- let obj = flag2(this, "object");
3567
- this.assert(
3568
- typeof obj === "number" && isFinite(obj),
3569
- "expected #{this} to be a finite number",
3570
- "expected #{this} to not be a finite number"
3571
- );
3572
- });
3573
- function compareSubset(expected, actual) {
3574
- if (expected === actual) {
3575
- return true;
3576
- }
3577
- if (typeof actual !== typeof expected) {
3578
- return false;
3579
- }
3580
- if (typeof expected !== "object" || expected === null) {
3581
- return expected === actual;
3582
- }
3583
- if (!actual) {
3584
- return false;
3585
- }
3586
- if (Array.isArray(expected)) {
3587
- if (!Array.isArray(actual)) {
3588
- return false;
3589
- }
3590
- return expected.every(function(exp) {
3591
- return actual.some(function(act) {
3592
- return compareSubset(exp, act);
3593
- });
3594
- });
3595
- }
3596
- if (expected instanceof Date) {
3597
- if (actual instanceof Date) {
3598
- return expected.getTime() === actual.getTime();
3599
- } else {
3600
- return false;
3601
- }
3602
- }
3603
- return Object.keys(expected).every(function(key) {
3604
- let expectedValue = expected[key];
3605
- let actualValue = actual[key];
3606
- if (typeof expectedValue === "object" && expectedValue !== null && actualValue !== null) {
3607
- return compareSubset(expectedValue, actualValue);
3608
- }
3609
- if (typeof expectedValue === "function") {
3610
- return expectedValue(actualValue);
3611
- }
3612
- return actualValue === expectedValue;
3613
- });
3614
- }
3615
- __name(compareSubset, "compareSubset");
3616
- Assertion.addMethod("containSubset", function(expected) {
3617
- const actual = flag(this, "object");
3618
- const showDiff = config.showDiff;
3619
- this.assert(
3620
- compareSubset(expected, actual),
3621
- "expected #{act} to contain subset #{exp}",
3622
- "expected #{act} to not contain subset #{exp}",
3623
- expected,
3624
- actual,
3625
- showDiff
3626
- );
3627
- });
3628
- function expect(val, message) {
3629
- return new Assertion(val, message);
3630
- }
3631
- __name(expect, "expect");
3632
- expect.fail = function(actual, expected, message, operator) {
3633
- if (arguments.length < 2) {
3634
- message = actual;
3635
- actual = void 0;
3636
- }
3637
- message = message || "expect.fail()";
3638
- throw new AssertionError(
3639
- message,
3640
- {
3641
- actual,
3642
- expected,
3643
- operator
3644
- },
3645
- expect.fail
3646
- );
3647
- };
3648
- var should_exports = {};
3649
- __export(should_exports, {
3650
- Should: () => Should,
3651
- should: () => should
3652
- });
3653
- function loadShould() {
3654
- function shouldGetter() {
3655
- if (this instanceof String || this instanceof Number || this instanceof Boolean || typeof Symbol === "function" && this instanceof Symbol || typeof BigInt === "function" && this instanceof BigInt) {
3656
- return new Assertion(this.valueOf(), null, shouldGetter);
3657
- }
3658
- return new Assertion(this, null, shouldGetter);
3659
- }
3660
- __name(shouldGetter, "shouldGetter");
3661
- function shouldSetter(value) {
3662
- Object.defineProperty(this, "should", {
3663
- value,
3664
- enumerable: true,
3665
- configurable: true,
3666
- writable: true
3667
- });
3668
- }
3669
- __name(shouldSetter, "shouldSetter");
3670
- Object.defineProperty(Object.prototype, "should", {
3671
- set: shouldSetter,
3672
- get: shouldGetter,
3673
- configurable: true
3674
- });
3675
- let should2 = {};
3676
- should2.fail = function(actual, expected, message, operator) {
3677
- if (arguments.length < 2) {
3678
- message = actual;
3679
- actual = void 0;
3680
- }
3681
- message = message || "should.fail()";
3682
- throw new AssertionError(
3683
- message,
3684
- {
3685
- actual,
3686
- expected,
3687
- operator
3688
- },
3689
- should2.fail
3690
- );
3691
- };
3692
- should2.equal = function(actual, expected, message) {
3693
- new Assertion(actual, message).to.equal(expected);
3694
- };
3695
- should2.Throw = function(fn, errt, errs, msg) {
3696
- new Assertion(fn, msg).to.Throw(errt, errs);
3697
- };
3698
- should2.exist = function(val, msg) {
3699
- new Assertion(val, msg).to.exist;
3700
- };
3701
- should2.not = {};
3702
- should2.not.equal = function(actual, expected, msg) {
3703
- new Assertion(actual, msg).to.not.equal(expected);
3704
- };
3705
- should2.not.Throw = function(fn, errt, errs, msg) {
3706
- new Assertion(fn, msg).to.not.Throw(errt, errs);
3707
- };
3708
- should2.not.exist = function(val, msg) {
3709
- new Assertion(val, msg).to.not.exist;
3710
- };
3711
- should2["throw"] = should2["Throw"];
3712
- should2.not["throw"] = should2.not["Throw"];
3713
- return should2;
3714
- }
3715
- __name(loadShould, "loadShould");
3716
- var should = loadShould;
3717
- var Should = loadShould;
3718
- function assert(express, errmsg) {
3719
- let test2 = new Assertion(null, null, assert, true);
3720
- test2.assert(express, errmsg, "[ negation message unavailable ]");
3721
- }
3722
- __name(assert, "assert");
3723
- assert.fail = function(actual, expected, message, operator) {
3724
- if (arguments.length < 2) {
3725
- message = actual;
3726
- actual = void 0;
3727
- }
3728
- message = message || "assert.fail()";
3729
- throw new AssertionError(
3730
- message,
3731
- {
3732
- actual,
3733
- expected,
3734
- operator
3735
- },
3736
- assert.fail
3737
- );
3738
- };
3739
- assert.isOk = function(val, msg) {
3740
- new Assertion(val, msg, assert.isOk, true).is.ok;
3741
- };
3742
- assert.isNotOk = function(val, msg) {
3743
- new Assertion(val, msg, assert.isNotOk, true).is.not.ok;
3744
- };
3745
- assert.equal = function(act, exp, msg) {
3746
- let test2 = new Assertion(act, msg, assert.equal, true);
3747
- test2.assert(
3748
- exp == flag(test2, "object"),
3749
- "expected #{this} to equal #{exp}",
3750
- "expected #{this} to not equal #{act}",
3751
- exp,
3752
- act,
3753
- true
3754
- );
3755
- };
3756
- assert.notEqual = function(act, exp, msg) {
3757
- let test2 = new Assertion(act, msg, assert.notEqual, true);
3758
- test2.assert(
3759
- exp != flag(test2, "object"),
3760
- "expected #{this} to not equal #{exp}",
3761
- "expected #{this} to equal #{act}",
3762
- exp,
3763
- act,
3764
- true
3765
- );
3766
- };
3767
- assert.strictEqual = function(act, exp, msg) {
3768
- new Assertion(act, msg, assert.strictEqual, true).to.equal(exp);
3769
- };
3770
- assert.notStrictEqual = function(act, exp, msg) {
3771
- new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp);
3772
- };
3773
- assert.deepEqual = assert.deepStrictEqual = function(act, exp, msg) {
3774
- new Assertion(act, msg, assert.deepEqual, true).to.eql(exp);
3775
- };
3776
- assert.notDeepEqual = function(act, exp, msg) {
3777
- new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp);
3778
- };
3779
- assert.isAbove = function(val, abv, msg) {
3780
- new Assertion(val, msg, assert.isAbove, true).to.be.above(abv);
3781
- };
3782
- assert.isAtLeast = function(val, atlst, msg) {
3783
- new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst);
3784
- };
3785
- assert.isBelow = function(val, blw, msg) {
3786
- new Assertion(val, msg, assert.isBelow, true).to.be.below(blw);
3787
- };
3788
- assert.isAtMost = function(val, atmst, msg) {
3789
- new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst);
3790
- };
3791
- assert.isTrue = function(val, msg) {
3792
- new Assertion(val, msg, assert.isTrue, true).is["true"];
3793
- };
3794
- assert.isNotTrue = function(val, msg) {
3795
- new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true);
3796
- };
3797
- assert.isFalse = function(val, msg) {
3798
- new Assertion(val, msg, assert.isFalse, true).is["false"];
3799
- };
3800
- assert.isNotFalse = function(val, msg) {
3801
- new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false);
3802
- };
3803
- assert.isNull = function(val, msg) {
3804
- new Assertion(val, msg, assert.isNull, true).to.equal(null);
3805
- };
3806
- assert.isNotNull = function(val, msg) {
3807
- new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null);
3808
- };
3809
- assert.isNaN = function(val, msg) {
3810
- new Assertion(val, msg, assert.isNaN, true).to.be.NaN;
3811
- };
3812
- assert.isNotNaN = function(value, message) {
3813
- new Assertion(value, message, assert.isNotNaN, true).not.to.be.NaN;
3814
- };
3815
- assert.exists = function(val, msg) {
3816
- new Assertion(val, msg, assert.exists, true).to.exist;
3817
- };
3818
- assert.notExists = function(val, msg) {
3819
- new Assertion(val, msg, assert.notExists, true).to.not.exist;
3820
- };
3821
- assert.isUndefined = function(val, msg) {
3822
- new Assertion(val, msg, assert.isUndefined, true).to.equal(void 0);
3823
- };
3824
- assert.isDefined = function(val, msg) {
3825
- new Assertion(val, msg, assert.isDefined, true).to.not.equal(void 0);
3826
- };
3827
- assert.isCallable = function(value, message) {
3828
- new Assertion(value, message, assert.isCallable, true).is.callable;
3829
- };
3830
- assert.isNotCallable = function(value, message) {
3831
- new Assertion(value, message, assert.isNotCallable, true).is.not.callable;
3832
- };
3833
- assert.isObject = function(val, msg) {
3834
- new Assertion(val, msg, assert.isObject, true).to.be.a("object");
3835
- };
3836
- assert.isNotObject = function(val, msg) {
3837
- new Assertion(val, msg, assert.isNotObject, true).to.not.be.a("object");
3838
- };
3839
- assert.isArray = function(val, msg) {
3840
- new Assertion(val, msg, assert.isArray, true).to.be.an("array");
3841
- };
3842
- assert.isNotArray = function(val, msg) {
3843
- new Assertion(val, msg, assert.isNotArray, true).to.not.be.an("array");
3844
- };
3845
- assert.isString = function(val, msg) {
3846
- new Assertion(val, msg, assert.isString, true).to.be.a("string");
3847
- };
3848
- assert.isNotString = function(val, msg) {
3849
- new Assertion(val, msg, assert.isNotString, true).to.not.be.a("string");
3850
- };
3851
- assert.isNumber = function(val, msg) {
3852
- new Assertion(val, msg, assert.isNumber, true).to.be.a("number");
3853
- };
3854
- assert.isNotNumber = function(val, msg) {
3855
- new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a("number");
3856
- };
3857
- assert.isNumeric = function(val, msg) {
3858
- new Assertion(val, msg, assert.isNumeric, true).is.numeric;
3859
- };
3860
- assert.isNotNumeric = function(val, msg) {
3861
- new Assertion(val, msg, assert.isNotNumeric, true).is.not.numeric;
3862
- };
3863
- assert.isFinite = function(val, msg) {
3864
- new Assertion(val, msg, assert.isFinite, true).to.be.finite;
3865
- };
3866
- assert.isBoolean = function(val, msg) {
3867
- new Assertion(val, msg, assert.isBoolean, true).to.be.a("boolean");
3868
- };
3869
- assert.isNotBoolean = function(val, msg) {
3870
- new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a("boolean");
3871
- };
3872
- assert.typeOf = function(val, type3, msg) {
3873
- new Assertion(val, msg, assert.typeOf, true).to.be.a(type3);
3874
- };
3875
- assert.notTypeOf = function(value, type3, message) {
3876
- new Assertion(value, message, assert.notTypeOf, true).to.not.be.a(type3);
3877
- };
3878
- assert.instanceOf = function(val, type3, msg) {
3879
- new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type3);
3880
- };
3881
- assert.notInstanceOf = function(val, type3, msg) {
3882
- new Assertion(val, msg, assert.notInstanceOf, true).to.not.be.instanceOf(
3883
- type3
3884
- );
3885
- };
3886
- assert.include = function(exp, inc, msg) {
3887
- new Assertion(exp, msg, assert.include, true).include(inc);
3888
- };
3889
- assert.notInclude = function(exp, inc, msg) {
3890
- new Assertion(exp, msg, assert.notInclude, true).not.include(inc);
3891
- };
3892
- assert.deepInclude = function(exp, inc, msg) {
3893
- new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc);
3894
- };
3895
- assert.notDeepInclude = function(exp, inc, msg) {
3896
- new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc);
3897
- };
3898
- assert.nestedInclude = function(exp, inc, msg) {
3899
- new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc);
3900
- };
3901
- assert.notNestedInclude = function(exp, inc, msg) {
3902
- new Assertion(exp, msg, assert.notNestedInclude, true).not.nested.include(
3903
- inc
3904
- );
3905
- };
3906
- assert.deepNestedInclude = function(exp, inc, msg) {
3907
- new Assertion(exp, msg, assert.deepNestedInclude, true).deep.nested.include(
3908
- inc
3909
- );
3910
- };
3911
- assert.notDeepNestedInclude = function(exp, inc, msg) {
3912
- new Assertion(
3913
- exp,
3914
- msg,
3915
- assert.notDeepNestedInclude,
3916
- true
3917
- ).not.deep.nested.include(inc);
3918
- };
3919
- assert.ownInclude = function(exp, inc, msg) {
3920
- new Assertion(exp, msg, assert.ownInclude, true).own.include(inc);
3921
- };
3922
- assert.notOwnInclude = function(exp, inc, msg) {
3923
- new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc);
3924
- };
3925
- assert.deepOwnInclude = function(exp, inc, msg) {
3926
- new Assertion(exp, msg, assert.deepOwnInclude, true).deep.own.include(inc);
3927
- };
3928
- assert.notDeepOwnInclude = function(exp, inc, msg) {
3929
- new Assertion(exp, msg, assert.notDeepOwnInclude, true).not.deep.own.include(
3930
- inc
3931
- );
3932
- };
3933
- assert.match = function(exp, re, msg) {
3934
- new Assertion(exp, msg, assert.match, true).to.match(re);
3935
- };
3936
- assert.notMatch = function(exp, re, msg) {
3937
- new Assertion(exp, msg, assert.notMatch, true).to.not.match(re);
3938
- };
3939
- assert.property = function(obj, prop, msg) {
3940
- new Assertion(obj, msg, assert.property, true).to.have.property(prop);
3941
- };
3942
- assert.notProperty = function(obj, prop, msg) {
3943
- new Assertion(obj, msg, assert.notProperty, true).to.not.have.property(prop);
3944
- };
3945
- assert.propertyVal = function(obj, prop, val, msg) {
3946
- new Assertion(obj, msg, assert.propertyVal, true).to.have.property(prop, val);
3947
- };
3948
- assert.notPropertyVal = function(obj, prop, val, msg) {
3949
- new Assertion(obj, msg, assert.notPropertyVal, true).to.not.have.property(
3950
- prop,
3951
- val
3952
- );
3953
- };
3954
- assert.deepPropertyVal = function(obj, prop, val, msg) {
3955
- new Assertion(obj, msg, assert.deepPropertyVal, true).to.have.deep.property(
3956
- prop,
3957
- val
3958
- );
3959
- };
3960
- assert.notDeepPropertyVal = function(obj, prop, val, msg) {
3961
- new Assertion(
3962
- obj,
3963
- msg,
3964
- assert.notDeepPropertyVal,
3965
- true
3966
- ).to.not.have.deep.property(prop, val);
3967
- };
3968
- assert.ownProperty = function(obj, prop, msg) {
3969
- new Assertion(obj, msg, assert.ownProperty, true).to.have.own.property(prop);
3970
- };
3971
- assert.notOwnProperty = function(obj, prop, msg) {
3972
- new Assertion(obj, msg, assert.notOwnProperty, true).to.not.have.own.property(
3973
- prop
3974
- );
3975
- };
3976
- assert.ownPropertyVal = function(obj, prop, value, msg) {
3977
- new Assertion(obj, msg, assert.ownPropertyVal, true).to.have.own.property(
3978
- prop,
3979
- value
3980
- );
3981
- };
3982
- assert.notOwnPropertyVal = function(obj, prop, value, msg) {
3983
- new Assertion(
3984
- obj,
3985
- msg,
3986
- assert.notOwnPropertyVal,
3987
- true
3988
- ).to.not.have.own.property(prop, value);
3989
- };
3990
- assert.deepOwnPropertyVal = function(obj, prop, value, msg) {
3991
- new Assertion(
3992
- obj,
3993
- msg,
3994
- assert.deepOwnPropertyVal,
3995
- true
3996
- ).to.have.deep.own.property(prop, value);
3997
- };
3998
- assert.notDeepOwnPropertyVal = function(obj, prop, value, msg) {
3999
- new Assertion(
4000
- obj,
4001
- msg,
4002
- assert.notDeepOwnPropertyVal,
4003
- true
4004
- ).to.not.have.deep.own.property(prop, value);
4005
- };
4006
- assert.nestedProperty = function(obj, prop, msg) {
4007
- new Assertion(obj, msg, assert.nestedProperty, true).to.have.nested.property(
4008
- prop
4009
- );
4010
- };
4011
- assert.notNestedProperty = function(obj, prop, msg) {
4012
- new Assertion(
4013
- obj,
4014
- msg,
4015
- assert.notNestedProperty,
4016
- true
4017
- ).to.not.have.nested.property(prop);
4018
- };
4019
- assert.nestedPropertyVal = function(obj, prop, val, msg) {
4020
- new Assertion(
4021
- obj,
4022
- msg,
4023
- assert.nestedPropertyVal,
4024
- true
4025
- ).to.have.nested.property(prop, val);
4026
- };
4027
- assert.notNestedPropertyVal = function(obj, prop, val, msg) {
4028
- new Assertion(
4029
- obj,
4030
- msg,
4031
- assert.notNestedPropertyVal,
4032
- true
4033
- ).to.not.have.nested.property(prop, val);
4034
- };
4035
- assert.deepNestedPropertyVal = function(obj, prop, val, msg) {
4036
- new Assertion(
4037
- obj,
4038
- msg,
4039
- assert.deepNestedPropertyVal,
4040
- true
4041
- ).to.have.deep.nested.property(prop, val);
4042
- };
4043
- assert.notDeepNestedPropertyVal = function(obj, prop, val, msg) {
4044
- new Assertion(
4045
- obj,
4046
- msg,
4047
- assert.notDeepNestedPropertyVal,
4048
- true
4049
- ).to.not.have.deep.nested.property(prop, val);
4050
- };
4051
- assert.lengthOf = function(exp, len, msg) {
4052
- new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len);
4053
- };
4054
- assert.hasAnyKeys = function(obj, keys, msg) {
4055
- new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys);
4056
- };
4057
- assert.hasAllKeys = function(obj, keys, msg) {
4058
- new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys);
4059
- };
4060
- assert.containsAllKeys = function(obj, keys, msg) {
4061
- new Assertion(obj, msg, assert.containsAllKeys, true).to.contain.all.keys(
4062
- keys
4063
- );
4064
- };
4065
- assert.doesNotHaveAnyKeys = function(obj, keys, msg) {
4066
- new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true).to.not.have.any.keys(
4067
- keys
4068
- );
4069
- };
4070
- assert.doesNotHaveAllKeys = function(obj, keys, msg) {
4071
- new Assertion(obj, msg, assert.doesNotHaveAllKeys, true).to.not.have.all.keys(
4072
- keys
4073
- );
4074
- };
4075
- assert.hasAnyDeepKeys = function(obj, keys, msg) {
4076
- new Assertion(obj, msg, assert.hasAnyDeepKeys, true).to.have.any.deep.keys(
4077
- keys
4078
- );
4079
- };
4080
- assert.hasAllDeepKeys = function(obj, keys, msg) {
4081
- new Assertion(obj, msg, assert.hasAllDeepKeys, true).to.have.all.deep.keys(
4082
- keys
4083
- );
4084
- };
4085
- assert.containsAllDeepKeys = function(obj, keys, msg) {
4086
- new Assertion(
4087
- obj,
4088
- msg,
4089
- assert.containsAllDeepKeys,
4090
- true
4091
- ).to.contain.all.deep.keys(keys);
4092
- };
4093
- assert.doesNotHaveAnyDeepKeys = function(obj, keys, msg) {
4094
- new Assertion(
4095
- obj,
4096
- msg,
4097
- assert.doesNotHaveAnyDeepKeys,
4098
- true
4099
- ).to.not.have.any.deep.keys(keys);
4100
- };
4101
- assert.doesNotHaveAllDeepKeys = function(obj, keys, msg) {
4102
- new Assertion(
4103
- obj,
4104
- msg,
4105
- assert.doesNotHaveAllDeepKeys,
4106
- true
4107
- ).to.not.have.all.deep.keys(keys);
4108
- };
4109
- assert.throws = function(fn, errorLike, errMsgMatcher, msg) {
4110
- if ("string" === typeof errorLike || errorLike instanceof RegExp) {
4111
- errMsgMatcher = errorLike;
4112
- errorLike = null;
4113
- }
4114
- let assertErr = new Assertion(fn, msg, assert.throws, true).to.throw(
4115
- errorLike,
4116
- errMsgMatcher
4117
- );
4118
- return flag(assertErr, "object");
4119
- };
4120
- assert.doesNotThrow = function(fn, errorLike, errMsgMatcher, message) {
4121
- if ("string" === typeof errorLike || errorLike instanceof RegExp) {
4122
- errMsgMatcher = errorLike;
4123
- errorLike = null;
4124
- }
4125
- new Assertion(fn, message, assert.doesNotThrow, true).to.not.throw(
4126
- errorLike,
4127
- errMsgMatcher
4128
- );
4129
- };
4130
- assert.operator = function(val, operator, val2, msg) {
4131
- let ok;
4132
- switch (operator) {
4133
- case "==":
4134
- ok = val == val2;
4135
- break;
4136
- case "===":
4137
- ok = val === val2;
4138
- break;
4139
- case ">":
4140
- ok = val > val2;
4141
- break;
4142
- case ">=":
4143
- ok = val >= val2;
4144
- break;
4145
- case "<":
4146
- ok = val < val2;
4147
- break;
4148
- case "<=":
4149
- ok = val <= val2;
4150
- break;
4151
- case "!=":
4152
- ok = val != val2;
4153
- break;
4154
- case "!==":
4155
- ok = val !== val2;
4156
- break;
4157
- default:
4158
- msg = msg ? msg + ": " : msg;
4159
- throw new AssertionError(
4160
- msg + 'Invalid operator "' + operator + '"',
4161
- void 0,
4162
- assert.operator
4163
- );
4164
- }
4165
- let test2 = new Assertion(ok, msg, assert.operator, true);
4166
- test2.assert(
4167
- true === flag(test2, "object"),
4168
- "expected " + inspect2(val) + " to be " + operator + " " + inspect2(val2),
4169
- "expected " + inspect2(val) + " to not be " + operator + " " + inspect2(val2)
4170
- );
4171
- };
4172
- assert.closeTo = function(act, exp, delta, msg) {
4173
- new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta);
4174
- };
4175
- assert.approximately = function(act, exp, delta, msg) {
4176
- new Assertion(act, msg, assert.approximately, true).to.be.approximately(
4177
- exp,
4178
- delta
4179
- );
4180
- };
4181
- assert.sameMembers = function(set1, set2, msg) {
4182
- new Assertion(set1, msg, assert.sameMembers, true).to.have.same.members(set2);
4183
- };
4184
- assert.notSameMembers = function(set1, set2, msg) {
4185
- new Assertion(
4186
- set1,
4187
- msg,
4188
- assert.notSameMembers,
4189
- true
4190
- ).to.not.have.same.members(set2);
4191
- };
4192
- assert.sameDeepMembers = function(set1, set2, msg) {
4193
- new Assertion(
4194
- set1,
4195
- msg,
4196
- assert.sameDeepMembers,
4197
- true
4198
- ).to.have.same.deep.members(set2);
4199
- };
4200
- assert.notSameDeepMembers = function(set1, set2, msg) {
4201
- new Assertion(
4202
- set1,
4203
- msg,
4204
- assert.notSameDeepMembers,
4205
- true
4206
- ).to.not.have.same.deep.members(set2);
4207
- };
4208
- assert.sameOrderedMembers = function(set1, set2, msg) {
4209
- new Assertion(
4210
- set1,
4211
- msg,
4212
- assert.sameOrderedMembers,
4213
- true
4214
- ).to.have.same.ordered.members(set2);
4215
- };
4216
- assert.notSameOrderedMembers = function(set1, set2, msg) {
4217
- new Assertion(
4218
- set1,
4219
- msg,
4220
- assert.notSameOrderedMembers,
4221
- true
4222
- ).to.not.have.same.ordered.members(set2);
4223
- };
4224
- assert.sameDeepOrderedMembers = function(set1, set2, msg) {
4225
- new Assertion(
4226
- set1,
4227
- msg,
4228
- assert.sameDeepOrderedMembers,
4229
- true
4230
- ).to.have.same.deep.ordered.members(set2);
4231
- };
4232
- assert.notSameDeepOrderedMembers = function(set1, set2, msg) {
4233
- new Assertion(
4234
- set1,
4235
- msg,
4236
- assert.notSameDeepOrderedMembers,
4237
- true
4238
- ).to.not.have.same.deep.ordered.members(set2);
4239
- };
4240
- assert.includeMembers = function(superset, subset, msg) {
4241
- new Assertion(superset, msg, assert.includeMembers, true).to.include.members(
4242
- subset
4243
- );
4244
- };
4245
- assert.notIncludeMembers = function(superset, subset, msg) {
4246
- new Assertion(
4247
- superset,
4248
- msg,
4249
- assert.notIncludeMembers,
4250
- true
4251
- ).to.not.include.members(subset);
4252
- };
4253
- assert.includeDeepMembers = function(superset, subset, msg) {
4254
- new Assertion(
4255
- superset,
4256
- msg,
4257
- assert.includeDeepMembers,
4258
- true
4259
- ).to.include.deep.members(subset);
4260
- };
4261
- assert.notIncludeDeepMembers = function(superset, subset, msg) {
4262
- new Assertion(
4263
- superset,
4264
- msg,
4265
- assert.notIncludeDeepMembers,
4266
- true
4267
- ).to.not.include.deep.members(subset);
4268
- };
4269
- assert.includeOrderedMembers = function(superset, subset, msg) {
4270
- new Assertion(
4271
- superset,
4272
- msg,
4273
- assert.includeOrderedMembers,
4274
- true
4275
- ).to.include.ordered.members(subset);
4276
- };
4277
- assert.notIncludeOrderedMembers = function(superset, subset, msg) {
4278
- new Assertion(
4279
- superset,
4280
- msg,
4281
- assert.notIncludeOrderedMembers,
4282
- true
4283
- ).to.not.include.ordered.members(subset);
4284
- };
4285
- assert.includeDeepOrderedMembers = function(superset, subset, msg) {
4286
- new Assertion(
4287
- superset,
4288
- msg,
4289
- assert.includeDeepOrderedMembers,
4290
- true
4291
- ).to.include.deep.ordered.members(subset);
4292
- };
4293
- assert.notIncludeDeepOrderedMembers = function(superset, subset, msg) {
4294
- new Assertion(
4295
- superset,
4296
- msg,
4297
- assert.notIncludeDeepOrderedMembers,
4298
- true
4299
- ).to.not.include.deep.ordered.members(subset);
4300
- };
4301
- assert.oneOf = function(inList, list, msg) {
4302
- new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list);
4303
- };
4304
- assert.isIterable = function(obj, msg) {
4305
- if (obj == void 0 || !obj[Symbol.iterator]) {
4306
- msg = msg ? `${msg} expected ${inspect2(obj)} to be an iterable` : `expected ${inspect2(obj)} to be an iterable`;
4307
- throw new AssertionError(msg, void 0, assert.isIterable);
4308
- }
4309
- };
4310
- assert.changes = function(fn, obj, prop, msg) {
4311
- if (arguments.length === 3 && typeof obj === "function") {
4312
- msg = prop;
4313
- prop = null;
4314
- }
4315
- new Assertion(fn, msg, assert.changes, true).to.change(obj, prop);
4316
- };
4317
- assert.changesBy = function(fn, obj, prop, delta, msg) {
4318
- if (arguments.length === 4 && typeof obj === "function") {
4319
- let tmpMsg = delta;
4320
- delta = prop;
4321
- msg = tmpMsg;
4322
- } else if (arguments.length === 3) {
4323
- delta = prop;
4324
- prop = null;
4325
- }
4326
- new Assertion(fn, msg, assert.changesBy, true).to.change(obj, prop).by(delta);
4327
- };
4328
- assert.doesNotChange = function(fn, obj, prop, msg) {
4329
- if (arguments.length === 3 && typeof obj === "function") {
4330
- msg = prop;
4331
- prop = null;
4332
- }
4333
- return new Assertion(fn, msg, assert.doesNotChange, true).to.not.change(
4334
- obj,
4335
- prop
4336
- );
4337
- };
4338
- assert.changesButNotBy = function(fn, obj, prop, delta, msg) {
4339
- if (arguments.length === 4 && typeof obj === "function") {
4340
- let tmpMsg = delta;
4341
- delta = prop;
4342
- msg = tmpMsg;
4343
- } else if (arguments.length === 3) {
4344
- delta = prop;
4345
- prop = null;
4346
- }
4347
- new Assertion(fn, msg, assert.changesButNotBy, true).to.change(obj, prop).but.not.by(delta);
4348
- };
4349
- assert.increases = function(fn, obj, prop, msg) {
4350
- if (arguments.length === 3 && typeof obj === "function") {
4351
- msg = prop;
4352
- prop = null;
4353
- }
4354
- return new Assertion(fn, msg, assert.increases, true).to.increase(obj, prop);
4355
- };
4356
- assert.increasesBy = function(fn, obj, prop, delta, msg) {
4357
- if (arguments.length === 4 && typeof obj === "function") {
4358
- let tmpMsg = delta;
4359
- delta = prop;
4360
- msg = tmpMsg;
4361
- } else if (arguments.length === 3) {
4362
- delta = prop;
4363
- prop = null;
4364
- }
4365
- new Assertion(fn, msg, assert.increasesBy, true).to.increase(obj, prop).by(delta);
4366
- };
4367
- assert.doesNotIncrease = function(fn, obj, prop, msg) {
4368
- if (arguments.length === 3 && typeof obj === "function") {
4369
- msg = prop;
4370
- prop = null;
4371
- }
4372
- return new Assertion(fn, msg, assert.doesNotIncrease, true).to.not.increase(
4373
- obj,
4374
- prop
4375
- );
4376
- };
4377
- assert.increasesButNotBy = function(fn, obj, prop, delta, msg) {
4378
- if (arguments.length === 4 && typeof obj === "function") {
4379
- let tmpMsg = delta;
4380
- delta = prop;
4381
- msg = tmpMsg;
4382
- } else if (arguments.length === 3) {
4383
- delta = prop;
4384
- prop = null;
4385
- }
4386
- new Assertion(fn, msg, assert.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta);
4387
- };
4388
- assert.decreases = function(fn, obj, prop, msg) {
4389
- if (arguments.length === 3 && typeof obj === "function") {
4390
- msg = prop;
4391
- prop = null;
4392
- }
4393
- return new Assertion(fn, msg, assert.decreases, true).to.decrease(obj, prop);
4394
- };
4395
- assert.decreasesBy = function(fn, obj, prop, delta, msg) {
4396
- if (arguments.length === 4 && typeof obj === "function") {
4397
- let tmpMsg = delta;
4398
- delta = prop;
4399
- msg = tmpMsg;
4400
- } else if (arguments.length === 3) {
4401
- delta = prop;
4402
- prop = null;
4403
- }
4404
- new Assertion(fn, msg, assert.decreasesBy, true).to.decrease(obj, prop).by(delta);
4405
- };
4406
- assert.doesNotDecrease = function(fn, obj, prop, msg) {
4407
- if (arguments.length === 3 && typeof obj === "function") {
4408
- msg = prop;
4409
- prop = null;
4410
- }
4411
- return new Assertion(fn, msg, assert.doesNotDecrease, true).to.not.decrease(
4412
- obj,
4413
- prop
4414
- );
4415
- };
4416
- assert.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) {
4417
- if (arguments.length === 4 && typeof obj === "function") {
4418
- let tmpMsg = delta;
4419
- delta = prop;
4420
- msg = tmpMsg;
4421
- } else if (arguments.length === 3) {
4422
- delta = prop;
4423
- prop = null;
4424
- }
4425
- return new Assertion(fn, msg, assert.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta);
4426
- };
4427
- assert.decreasesButNotBy = function(fn, obj, prop, delta, msg) {
4428
- if (arguments.length === 4 && typeof obj === "function") {
4429
- let tmpMsg = delta;
4430
- delta = prop;
4431
- msg = tmpMsg;
4432
- } else if (arguments.length === 3) {
4433
- delta = prop;
4434
- prop = null;
4435
- }
4436
- new Assertion(fn, msg, assert.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta);
4437
- };
4438
- assert.ifError = function(val) {
4439
- if (val) {
4440
- throw val;
4441
- }
4442
- };
4443
- assert.isExtensible = function(obj, msg) {
4444
- new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible;
4445
- };
4446
- assert.isNotExtensible = function(obj, msg) {
4447
- new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible;
4448
- };
4449
- assert.isSealed = function(obj, msg) {
4450
- new Assertion(obj, msg, assert.isSealed, true).to.be.sealed;
4451
- };
4452
- assert.isNotSealed = function(obj, msg) {
4453
- new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed;
4454
- };
4455
- assert.isFrozen = function(obj, msg) {
4456
- new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen;
4457
- };
4458
- assert.isNotFrozen = function(obj, msg) {
4459
- new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen;
4460
- };
4461
- assert.isEmpty = function(val, msg) {
4462
- new Assertion(val, msg, assert.isEmpty, true).to.be.empty;
4463
- };
4464
- assert.isNotEmpty = function(val, msg) {
4465
- new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty;
4466
- };
4467
- assert.containsSubset = function(val, exp, msg) {
4468
- new Assertion(val, msg).to.containSubset(exp);
4469
- };
4470
- assert.doesNotContainSubset = function(val, exp, msg) {
4471
- new Assertion(val, msg).to.not.containSubset(exp);
4472
- };
4473
- var aliases = [
4474
- ["isOk", "ok"],
4475
- ["isNotOk", "notOk"],
4476
- ["throws", "throw"],
4477
- ["throws", "Throw"],
4478
- ["isExtensible", "extensible"],
4479
- ["isNotExtensible", "notExtensible"],
4480
- ["isSealed", "sealed"],
4481
- ["isNotSealed", "notSealed"],
4482
- ["isFrozen", "frozen"],
4483
- ["isNotFrozen", "notFrozen"],
4484
- ["isEmpty", "empty"],
4485
- ["isNotEmpty", "notEmpty"],
4486
- ["isCallable", "isFunction"],
4487
- ["isNotCallable", "isNotFunction"],
4488
- ["containsSubset", "containSubset"]
4489
- ];
4490
- for (const [name, as] of aliases) {
4491
- assert[as] = assert[name];
4492
- }
4493
- var used = [];
4494
- function use(fn) {
4495
- const exports = {
4496
- use,
4497
- AssertionError,
4498
- util: utils_exports,
4499
- config,
4500
- expect,
4501
- assert,
4502
- Assertion,
4503
- ...should_exports
4504
- };
4505
- if (!~used.indexOf(fn)) {
4506
- fn(exports, utils_exports);
4507
- used.push(fn);
4508
- }
4509
- return exports;
4510
- }
4511
- __name(use, "use");
4512
-
4513
- // src/lib/pmProxy.test/adapter.ts
4514
- var testAdapter = {
4515
- beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
4516
- return subject;
4517
- },
4518
- andWhen: async (store, whenCB, testResource, pm) => {
4519
- const proxiedPM = andWhenProxy(pm, "some/path", (path) => {
4520
- console.log("Artifact added:", path);
4521
- return path;
4522
- });
4523
- return whenCB(store, proxiedPM);
4524
- },
4525
- butThen: async (store, thenCB, testResource, pm) => {
4526
- const proxiedPM = butThenProxy(pm, "some/path", (path) => {
4527
- console.log("Artifact added:", path);
4528
- return path;
4529
- });
4530
- return thenCB(store, proxiedPM);
4531
- },
4532
- afterEach: async (store, key, pm) => store,
4533
- afterAll: async (store, pm) => {
4534
- },
4535
- beforeAll: async (input, testResource, pm, theGivenString) => {
4536
- return {
4537
- beforeEachProxy: input.butThenProxy(
4538
- new MockPMBase(),
4539
- theGivenString
4540
- )
4541
- };
4542
- },
4543
- assertThis: (returnedFilePath, expectation) => {
4544
- assert.equal(returnedFilePath, expectation);
4545
- }
4546
- };
4547
-
4548
- // src/lib/pmProxy.test/index.ts
4549
- var pmProxy_default = Node_default(
4550
- // because of the nature of testeranto, we must add all the testable items here
4551
- {
4552
- butThenProxy
4553
- },
4554
- specification,
4555
- implementation,
4556
- testAdapter
4557
- );
4558
- export {
4559
- pmProxy_default as default
4560
- };
4561
- /*! Bundled license information:
4562
-
4563
- chai/chai.js:
4564
- (*!
4565
- * Chai - flag utility
4566
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4567
- * MIT Licensed
4568
- *)
4569
- (*!
4570
- * Chai - test utility
4571
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4572
- * MIT Licensed
4573
- *)
4574
- (*!
4575
- * Chai - expectTypes utility
4576
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4577
- * MIT Licensed
4578
- *)
4579
- (*!
4580
- * Chai - getActual utility
4581
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4582
- * MIT Licensed
4583
- *)
4584
- (*!
4585
- * Chai - message composition utility
4586
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4587
- * MIT Licensed
4588
- *)
4589
- (*!
4590
- * Chai - transferFlags utility
4591
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4592
- * MIT Licensed
4593
- *)
4594
- (*!
4595
- * chai
4596
- * http://chaijs.com
4597
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
4598
- * MIT Licensed
4599
- *)
4600
- (*!
4601
- * Chai - isProxyEnabled helper
4602
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4603
- * MIT Licensed
4604
- *)
4605
- (*!
4606
- * Chai - addProperty utility
4607
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4608
- * MIT Licensed
4609
- *)
4610
- (*!
4611
- * Chai - addLengthGuard utility
4612
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4613
- * MIT Licensed
4614
- *)
4615
- (*!
4616
- * Chai - getProperties utility
4617
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4618
- * MIT Licensed
4619
- *)
4620
- (*!
4621
- * Chai - proxify utility
4622
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4623
- * MIT Licensed
4624
- *)
4625
- (*!
4626
- * Chai - addMethod utility
4627
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4628
- * MIT Licensed
4629
- *)
4630
- (*!
4631
- * Chai - overwriteProperty utility
4632
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4633
- * MIT Licensed
4634
- *)
4635
- (*!
4636
- * Chai - overwriteMethod utility
4637
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4638
- * MIT Licensed
4639
- *)
4640
- (*!
4641
- * Chai - addChainingMethod utility
4642
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4643
- * MIT Licensed
4644
- *)
4645
- (*!
4646
- * Chai - overwriteChainableMethod utility
4647
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4648
- * MIT Licensed
4649
- *)
4650
- (*!
4651
- * Chai - compareByInspect utility
4652
- * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
4653
- * MIT Licensed
4654
- *)
4655
- (*!
4656
- * Chai - getOwnEnumerablePropertySymbols utility
4657
- * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
4658
- * MIT Licensed
4659
- *)
4660
- (*!
4661
- * Chai - getOwnEnumerableProperties utility
4662
- * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
4663
- * MIT Licensed
4664
- *)
4665
- (*!
4666
- * Chai - isNaN utility
4667
- * Copyright(c) 2012-2015 Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
4668
- * MIT Licensed
4669
- *)
4670
- (*!
4671
- * chai
4672
- * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
4673
- * MIT Licensed
4674
- *)
4675
- (*!
4676
- * chai
4677
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
4678
- * MIT Licensed
4679
- *)
4680
- (*! Bundled license information:
4681
-
4682
- deep-eql/index.js:
4683
- (*!
4684
- * deep-eql
4685
- * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
4686
- * MIT Licensed
4687
- *)
4688
- (*!
4689
- * Check to see if the MemoizeMap has recorded a result of the two operands
4690
- *
4691
- * @param {Mixed} leftHandOperand
4692
- * @param {Mixed} rightHandOperand
4693
- * @param {MemoizeMap} memoizeMap
4694
- * @returns {Boolean|null} result
4695
- *)
4696
- (*!
4697
- * Set the result of the equality into the MemoizeMap
4698
- *
4699
- * @param {Mixed} leftHandOperand
4700
- * @param {Mixed} rightHandOperand
4701
- * @param {MemoizeMap} memoizeMap
4702
- * @param {Boolean} result
4703
- *)
4704
- (*!
4705
- * Primary Export
4706
- *)
4707
- (*!
4708
- * The main logic of the `deepEqual` function.
4709
- *
4710
- * @param {Mixed} leftHandOperand
4711
- * @param {Mixed} rightHandOperand
4712
- * @param {Object} [options] (optional) Additional options
4713
- * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality.
4714
- * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of
4715
- complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular
4716
- references to blow the stack.
4717
- * @return {Boolean} equal match
4718
- *)
4719
- (*!
4720
- * Compare two Regular Expressions for equality.
4721
- *
4722
- * @param {RegExp} leftHandOperand
4723
- * @param {RegExp} rightHandOperand
4724
- * @return {Boolean} result
4725
- *)
4726
- (*!
4727
- * Compare two Sets/Maps for equality. Faster than other equality functions.
4728
- *
4729
- * @param {Set} leftHandOperand
4730
- * @param {Set} rightHandOperand
4731
- * @param {Object} [options] (Optional)
4732
- * @return {Boolean} result
4733
- *)
4734
- (*!
4735
- * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers.
4736
- *
4737
- * @param {Iterable} leftHandOperand
4738
- * @param {Iterable} rightHandOperand
4739
- * @param {Object} [options] (Optional)
4740
- * @return {Boolean} result
4741
- *)
4742
- (*!
4743
- * Simple equality for generator objects such as those returned by generator functions.
4744
- *
4745
- * @param {Iterable} leftHandOperand
4746
- * @param {Iterable} rightHandOperand
4747
- * @param {Object} [options] (Optional)
4748
- * @return {Boolean} result
4749
- *)
4750
- (*!
4751
- * Determine if the given object has an @@iterator function.
4752
- *
4753
- * @param {Object} target
4754
- * @return {Boolean} `true` if the object has an @@iterator function.
4755
- *)
4756
- (*!
4757
- * Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array.
4758
- * This will consume the iterator - which could have side effects depending on the @@iterator implementation.
4759
- *
4760
- * @param {Object} target
4761
- * @returns {Array} an array of entries from the @@iterator function
4762
- *)
4763
- (*!
4764
- * Gets all entries from a Generator. This will consume the generator - which could have side effects.
4765
- *
4766
- * @param {Generator} target
4767
- * @returns {Array} an array of entries from the Generator.
4768
- *)
4769
- (*!
4770
- * Gets all own and inherited enumerable keys from a target.
4771
- *
4772
- * @param {Object} target
4773
- * @returns {Array} an array of own and inherited enumerable keys from the target.
4774
- *)
4775
- (*!
4776
- * Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
4777
- * each key. If any value of the given key is not equal, the function will return false (early).
4778
- *
4779
- * @param {Mixed} leftHandOperand
4780
- * @param {Mixed} rightHandOperand
4781
- * @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against
4782
- * @param {Object} [options] (Optional)
4783
- * @return {Boolean} result
4784
- *)
4785
- (*!
4786
- * Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual`
4787
- * for each enumerable key in the object.
4788
- *
4789
- * @param {Mixed} leftHandOperand
4790
- * @param {Mixed} rightHandOperand
4791
- * @param {Object} [options] (Optional)
4792
- * @return {Boolean} result
4793
- *)
4794
- (*!
4795
- * Returns true if the argument is a primitive.
4796
- *
4797
- * This intentionally returns true for all objects that can be compared by reference,
4798
- * including functions and symbols.
4799
- *
4800
- * @param {Mixed} value
4801
- * @return {Boolean} result
4802
- *)
4803
- *)
4804
- */