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