@metamask/snaps-jest 5.0.0 → 6.0.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 (519) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/dist/chunk-2KLZ7GOW.js +15 -0
  3. package/dist/chunk-2KLZ7GOW.js.map +1 -0
  4. package/dist/chunk-2M7WQ26F.js +28 -0
  5. package/dist/chunk-2M7WQ26F.js.map +1 -0
  6. package/dist/chunk-34GS3AHA.js +33 -0
  7. package/dist/chunk-34GS3AHA.js.map +1 -0
  8. package/dist/chunk-3CC2NI7R.js +80 -0
  9. package/dist/chunk-3CC2NI7R.js.map +1 -0
  10. package/dist/chunk-3IUQA6YL.mjs +1 -0
  11. package/dist/chunk-3IUQA6YL.mjs.map +1 -0
  12. package/dist/chunk-3KCEPGJA.js +39 -0
  13. package/dist/chunk-3KCEPGJA.js.map +1 -0
  14. package/dist/chunk-3KQYPQZY.js +20 -0
  15. package/dist/chunk-3KQYPQZY.js.map +1 -0
  16. package/dist/chunk-3O5OISLU.js +16 -0
  17. package/dist/chunk-3O5OISLU.js.map +1 -0
  18. package/dist/chunk-3ZW2EE3B.js +1 -0
  19. package/dist/chunk-3ZW2EE3B.js.map +1 -0
  20. package/dist/chunk-4FCRZDOX.js +134 -0
  21. package/dist/chunk-4FCRZDOX.js.map +1 -0
  22. package/dist/chunk-4HY4SM3A.js +1 -0
  23. package/dist/chunk-4HY4SM3A.js.map +1 -0
  24. package/dist/chunk-4JUUFDTC.js +104 -0
  25. package/dist/chunk-4JUUFDTC.js.map +1 -0
  26. package/dist/chunk-4VCE3DRR.mjs +34 -0
  27. package/dist/chunk-4VCE3DRR.mjs.map +1 -0
  28. package/dist/chunk-4WCFXE73.js +48 -0
  29. package/dist/chunk-4WCFXE73.js.map +1 -0
  30. package/dist/chunk-5IUHGC5S.js +153 -0
  31. package/dist/chunk-5IUHGC5S.js.map +1 -0
  32. package/dist/chunk-5O6VBW42.js +42 -0
  33. package/dist/chunk-5O6VBW42.js.map +1 -0
  34. package/dist/chunk-6IMEYERE.js +137 -0
  35. package/dist/chunk-6IMEYERE.js.map +1 -0
  36. package/dist/chunk-6KNT4UMX.mjs +35 -0
  37. package/dist/chunk-6KNT4UMX.mjs.map +1 -0
  38. package/dist/chunk-6RDNSELT.mjs +39 -0
  39. package/dist/chunk-6RDNSELT.mjs.map +1 -0
  40. package/dist/chunk-72YN2D26.mjs +60 -0
  41. package/dist/chunk-72YN2D26.mjs.map +1 -0
  42. package/dist/chunk-7JLVQJK7.js +14 -0
  43. package/dist/chunk-7JLVQJK7.js.map +1 -0
  44. package/dist/chunk-AH7YNG6N.js +22 -0
  45. package/dist/chunk-AH7YNG6N.js.map +1 -0
  46. package/dist/chunk-AIZADBRK.mjs +36 -0
  47. package/dist/chunk-AIZADBRK.mjs.map +1 -0
  48. package/dist/chunk-AKFRQ5EJ.mjs +42 -0
  49. package/dist/chunk-AKFRQ5EJ.mjs.map +1 -0
  50. package/dist/chunk-AUB7XPDH.mjs +28 -0
  51. package/dist/chunk-AUB7XPDH.mjs.map +1 -0
  52. package/dist/chunk-BJMTD7H2.mjs +20 -0
  53. package/dist/chunk-BJMTD7H2.mjs.map +1 -0
  54. package/dist/chunk-BN5VBVT3.mjs +233 -0
  55. package/dist/chunk-BN5VBVT3.mjs.map +1 -0
  56. package/dist/chunk-CKOGTHM4.mjs +22 -0
  57. package/dist/chunk-CKOGTHM4.mjs.map +1 -0
  58. package/dist/chunk-CZQKOZLR.js +11 -0
  59. package/dist/chunk-CZQKOZLR.js.map +1 -0
  60. package/dist/chunk-D36QBJ35.js +24 -0
  61. package/dist/{cjs/internals/simulation/methods/hooks/show-dialog.js.map → chunk-D36QBJ35.js.map} +1 -1
  62. package/dist/chunk-DEFFA5IJ.mjs +24 -0
  63. package/dist/chunk-DEFFA5IJ.mjs.map +1 -0
  64. package/dist/chunk-EFB6AQPB.js +36 -0
  65. package/dist/chunk-EFB6AQPB.js.map +1 -0
  66. package/dist/chunk-EOCDSPT7.mjs +97 -0
  67. package/dist/chunk-EOCDSPT7.mjs.map +1 -0
  68. package/dist/chunk-FPFX5AKR.mjs +36 -0
  69. package/dist/chunk-FPFX5AKR.mjs.map +1 -0
  70. package/dist/chunk-HBT34TJ2.mjs +1 -0
  71. package/dist/chunk-HBT34TJ2.mjs.map +1 -0
  72. package/dist/chunk-HBVDXIVN.mjs +80 -0
  73. package/dist/chunk-HBVDXIVN.mjs.map +1 -0
  74. package/dist/chunk-HMF2CKYT.mjs +39 -0
  75. package/dist/chunk-HMF2CKYT.mjs.map +1 -0
  76. package/dist/chunk-HP56MLQ3.js +1 -0
  77. package/dist/chunk-HP56MLQ3.js.map +1 -0
  78. package/dist/chunk-I5LVU57H.mjs +69 -0
  79. package/dist/chunk-I5LVU57H.mjs.map +1 -0
  80. package/dist/chunk-I7FLOZU7.mjs +1 -0
  81. package/dist/chunk-I7FLOZU7.mjs.map +1 -0
  82. package/dist/chunk-J2ID3DS7.mjs +33 -0
  83. package/dist/chunk-J2ID3DS7.mjs.map +1 -0
  84. package/dist/chunk-JA7RJLI7.js +34 -0
  85. package/dist/chunk-JA7RJLI7.js.map +1 -0
  86. package/dist/chunk-JB2H2XEL.mjs +1 -0
  87. package/dist/chunk-JB2H2XEL.mjs.map +1 -0
  88. package/dist/chunk-JDN3VGMO.js +21 -0
  89. package/dist/chunk-JDN3VGMO.js.map +1 -0
  90. package/dist/chunk-JGQJFYU4.js +57 -0
  91. package/dist/chunk-JGQJFYU4.js.map +1 -0
  92. package/dist/chunk-JJCX335U.mjs +91 -0
  93. package/dist/chunk-JJCX335U.mjs.map +1 -0
  94. package/dist/chunk-JMDSN227.mjs +25 -0
  95. package/dist/chunk-JMDSN227.mjs.map +1 -0
  96. package/dist/chunk-JXOKRTEH.mjs +11 -0
  97. package/dist/chunk-JXOKRTEH.mjs.map +1 -0
  98. package/dist/chunk-JZJWUVD7.mjs +1 -0
  99. package/dist/chunk-JZJWUVD7.mjs.map +1 -0
  100. package/dist/chunk-K2KTKFLP.js +76 -0
  101. package/dist/chunk-K2KTKFLP.js.map +1 -0
  102. package/dist/chunk-KGIWSGTT.js +91 -0
  103. package/dist/chunk-KGIWSGTT.js.map +1 -0
  104. package/dist/chunk-KPXLJ6RH.js +60 -0
  105. package/dist/chunk-KPXLJ6RH.js.map +1 -0
  106. package/dist/chunk-LD5PSHHT.mjs +57 -0
  107. package/dist/chunk-LD5PSHHT.mjs.map +1 -0
  108. package/dist/chunk-LNNKGOHQ.mjs +16 -0
  109. package/dist/chunk-LNNKGOHQ.mjs.map +1 -0
  110. package/dist/chunk-MNDF32ZV.js +8 -0
  111. package/dist/chunk-MNDF32ZV.js.map +1 -0
  112. package/dist/chunk-MSQ7Q2VJ.mjs +13 -0
  113. package/dist/chunk-MSQ7Q2VJ.mjs.map +1 -0
  114. package/dist/chunk-O3VJYBFN.mjs +15 -0
  115. package/dist/chunk-O3VJYBFN.mjs.map +1 -0
  116. package/dist/chunk-O4MJRHZD.js +69 -0
  117. package/dist/chunk-O4MJRHZD.js.map +1 -0
  118. package/dist/chunk-OC64PNDU.mjs +21 -0
  119. package/dist/chunk-OC64PNDU.mjs.map +1 -0
  120. package/dist/chunk-ON6M4WG5.js +36 -0
  121. package/dist/chunk-ON6M4WG5.js.map +1 -0
  122. package/dist/chunk-P7JA42ZC.mjs +153 -0
  123. package/dist/chunk-P7JA42ZC.mjs.map +1 -0
  124. package/dist/chunk-PHUTP7NB.js +25 -0
  125. package/dist/chunk-PHUTP7NB.js.map +1 -0
  126. package/dist/chunk-QFPRGU5L.mjs +104 -0
  127. package/dist/chunk-QFPRGU5L.mjs.map +1 -0
  128. package/dist/chunk-QMHWGASM.js +1 -0
  129. package/dist/chunk-QMHWGASM.js.map +1 -0
  130. package/dist/chunk-QNDLJ2W7.js +1 -0
  131. package/dist/chunk-QNDLJ2W7.js.map +1 -0
  132. package/dist/chunk-QUUILTDY.mjs +137 -0
  133. package/dist/chunk-QUUILTDY.mjs.map +1 -0
  134. package/dist/chunk-R7ORBTUD.js +1 -0
  135. package/dist/chunk-R7ORBTUD.js.map +1 -0
  136. package/dist/chunk-RQBZLDXL.js +233 -0
  137. package/dist/chunk-RQBZLDXL.js.map +1 -0
  138. package/dist/chunk-S3DHQTXB.js +1 -0
  139. package/dist/chunk-S3DHQTXB.js.map +1 -0
  140. package/dist/chunk-SWSSV3LK.js +35 -0
  141. package/dist/chunk-SWSSV3LK.js.map +1 -0
  142. package/dist/chunk-T4TRX3ZR.js +22 -0
  143. package/dist/chunk-T4TRX3ZR.js.map +1 -0
  144. package/dist/chunk-UXHKMILA.mjs +1 -0
  145. package/dist/chunk-UXHKMILA.mjs.map +1 -0
  146. package/dist/chunk-VCXM6FKU.mjs +1 -0
  147. package/dist/chunk-VCXM6FKU.mjs.map +1 -0
  148. package/dist/chunk-VHTVUQWR.mjs +14 -0
  149. package/dist/chunk-VHTVUQWR.mjs.map +1 -0
  150. package/dist/chunk-VNQIROKZ.js +97 -0
  151. package/dist/chunk-VNQIROKZ.js.map +1 -0
  152. package/dist/chunk-VXQOXWRO.mjs +48 -0
  153. package/dist/chunk-VXQOXWRO.mjs.map +1 -0
  154. package/dist/chunk-VYKYQSUI.mjs +22 -0
  155. package/dist/chunk-VYKYQSUI.mjs.map +1 -0
  156. package/dist/chunk-WEI35OIM.mjs +8 -0
  157. package/dist/chunk-WEI35OIM.mjs.map +1 -0
  158. package/dist/chunk-WL2GRM5E.mjs +76 -0
  159. package/dist/chunk-WL2GRM5E.mjs.map +1 -0
  160. package/dist/chunk-XDZPH5WD.js +39 -0
  161. package/dist/chunk-XDZPH5WD.js.map +1 -0
  162. package/dist/chunk-Y5NWZU43.js +13 -0
  163. package/dist/chunk-Y5NWZU43.js.map +1 -0
  164. package/dist/chunk-YZFWCFMG.js +1 -0
  165. package/dist/chunk-YZFWCFMG.js.map +1 -0
  166. package/dist/chunk-ZCE26WZM.mjs +1 -0
  167. package/dist/chunk-ZCE26WZM.mjs.map +1 -0
  168. package/dist/chunk-ZZPKZRJQ.mjs +134 -0
  169. package/dist/chunk-ZZPKZRJQ.mjs.map +1 -0
  170. package/dist/environment.js +47 -0
  171. package/dist/environment.js.map +1 -0
  172. package/dist/environment.mjs +47 -0
  173. package/dist/environment.mjs.map +1 -0
  174. package/dist/helpers.js +44 -0
  175. package/dist/helpers.js.map +1 -0
  176. package/dist/helpers.mjs +44 -0
  177. package/dist/helpers.mjs.map +1 -0
  178. package/dist/index.js +54 -0
  179. package/dist/index.js.map +1 -0
  180. package/dist/index.mjs +54 -0
  181. package/dist/index.mjs.map +1 -0
  182. package/dist/internals/environment.js +8 -0
  183. package/dist/internals/environment.js.map +1 -0
  184. package/dist/internals/environment.mjs +8 -0
  185. package/dist/internals/environment.mjs.map +1 -0
  186. package/dist/internals/index.js +123 -0
  187. package/dist/internals/index.js.map +1 -0
  188. package/dist/internals/index.mjs +123 -0
  189. package/dist/internals/index.mjs.map +1 -0
  190. package/dist/internals/logger.js +8 -0
  191. package/dist/internals/logger.js.map +1 -0
  192. package/dist/internals/logger.mjs +8 -0
  193. package/dist/internals/logger.mjs.map +1 -0
  194. package/dist/internals/request.js +40 -0
  195. package/dist/internals/request.js.map +1 -0
  196. package/dist/internals/request.mjs +40 -0
  197. package/dist/internals/request.mjs.map +1 -0
  198. package/dist/internals/server.js +9 -0
  199. package/dist/internals/server.js.map +1 -0
  200. package/dist/internals/server.mjs +9 -0
  201. package/dist/internals/server.mjs.map +1 -0
  202. package/dist/internals/simulation/constants.js +12 -0
  203. package/dist/internals/simulation/constants.js.map +1 -0
  204. package/dist/internals/simulation/constants.mjs +12 -0
  205. package/dist/internals/simulation/constants.mjs.map +1 -0
  206. package/dist/internals/simulation/controllers.js +26 -0
  207. package/dist/internals/simulation/controllers.js.map +1 -0
  208. package/dist/internals/simulation/controllers.mjs +26 -0
  209. package/dist/internals/simulation/controllers.mjs.map +1 -0
  210. package/dist/internals/simulation/files.js +8 -0
  211. package/dist/internals/simulation/files.js.map +1 -0
  212. package/dist/internals/simulation/files.mjs +8 -0
  213. package/dist/internals/simulation/files.mjs.map +1 -0
  214. package/dist/internals/simulation/index.js +90 -0
  215. package/dist/internals/simulation/index.js.map +1 -0
  216. package/dist/internals/simulation/index.mjs +90 -0
  217. package/dist/internals/simulation/index.mjs.map +1 -0
  218. package/dist/internals/simulation/interface.js +16 -0
  219. package/dist/internals/simulation/interface.js.map +1 -0
  220. package/dist/internals/simulation/interface.mjs +16 -0
  221. package/dist/internals/simulation/interface.mjs.map +1 -0
  222. package/dist/internals/simulation/methods/constants.js +12 -0
  223. package/dist/internals/simulation/methods/constants.js.map +1 -0
  224. package/dist/internals/simulation/methods/constants.mjs +12 -0
  225. package/dist/internals/simulation/methods/constants.mjs.map +1 -0
  226. package/dist/internals/simulation/methods/hooks/encryption.js +10 -0
  227. package/dist/internals/simulation/methods/hooks/encryption.js.map +1 -0
  228. package/dist/internals/simulation/methods/hooks/encryption.mjs +10 -0
  229. package/dist/internals/simulation/methods/hooks/encryption.mjs.map +1 -0
  230. package/dist/internals/simulation/methods/hooks/get-locale.js +8 -0
  231. package/dist/internals/simulation/methods/hooks/get-locale.js.map +1 -0
  232. package/dist/internals/simulation/methods/hooks/get-locale.mjs +8 -0
  233. package/dist/internals/simulation/methods/hooks/get-locale.mjs.map +1 -0
  234. package/dist/internals/simulation/methods/hooks/index.js +45 -0
  235. package/dist/internals/simulation/methods/hooks/index.js.map +1 -0
  236. package/dist/internals/simulation/methods/hooks/index.mjs +45 -0
  237. package/dist/internals/simulation/methods/hooks/index.mjs.map +1 -0
  238. package/dist/internals/simulation/methods/hooks/interface.js +10 -0
  239. package/dist/internals/simulation/methods/hooks/interface.js.map +1 -0
  240. package/dist/internals/simulation/methods/hooks/interface.mjs +10 -0
  241. package/dist/internals/simulation/methods/hooks/interface.mjs.map +1 -0
  242. package/dist/internals/simulation/methods/hooks/notifications.js +16 -0
  243. package/dist/internals/simulation/methods/hooks/notifications.js.map +1 -0
  244. package/dist/internals/simulation/methods/hooks/notifications.mjs +16 -0
  245. package/dist/internals/simulation/methods/hooks/notifications.mjs.map +1 -0
  246. package/dist/internals/simulation/methods/hooks/show-dialog.js +14 -0
  247. package/dist/internals/simulation/methods/hooks/show-dialog.js.map +1 -0
  248. package/dist/internals/simulation/methods/hooks/show-dialog.mjs +14 -0
  249. package/dist/internals/simulation/methods/hooks/show-dialog.mjs.map +1 -0
  250. package/dist/internals/simulation/methods/hooks/state.js +18 -0
  251. package/dist/internals/simulation/methods/hooks/state.js.map +1 -0
  252. package/dist/internals/simulation/methods/hooks/state.mjs +18 -0
  253. package/dist/internals/simulation/methods/hooks/state.mjs.map +1 -0
  254. package/dist/internals/simulation/methods/index.js +29 -0
  255. package/dist/internals/simulation/methods/index.js.map +1 -0
  256. package/dist/internals/simulation/methods/index.mjs +29 -0
  257. package/dist/internals/simulation/methods/index.mjs.map +1 -0
  258. package/dist/internals/simulation/methods/specifications.js +28 -0
  259. package/dist/internals/simulation/methods/specifications.js.map +1 -0
  260. package/dist/internals/simulation/methods/specifications.mjs +28 -0
  261. package/dist/internals/simulation/methods/specifications.mjs.map +1 -0
  262. package/dist/internals/simulation/middleware/engine.js +15 -0
  263. package/dist/internals/simulation/middleware/engine.js.map +1 -0
  264. package/dist/internals/simulation/middleware/engine.mjs +15 -0
  265. package/dist/internals/simulation/middleware/engine.mjs.map +1 -0
  266. package/dist/internals/simulation/middleware/index.js +16 -0
  267. package/dist/internals/simulation/middleware/index.js.map +1 -0
  268. package/dist/internals/simulation/middleware/index.mjs +16 -0
  269. package/dist/internals/simulation/middleware/index.mjs.map +1 -0
  270. package/dist/internals/simulation/middleware/internal-methods/accounts.js +8 -0
  271. package/dist/internals/simulation/middleware/internal-methods/accounts.js.map +1 -0
  272. package/dist/internals/simulation/middleware/internal-methods/accounts.mjs +8 -0
  273. package/dist/internals/simulation/middleware/internal-methods/accounts.mjs.map +1 -0
  274. package/dist/internals/simulation/middleware/internal-methods/index.js +11 -0
  275. package/dist/internals/simulation/middleware/internal-methods/index.js.map +1 -0
  276. package/dist/internals/simulation/middleware/internal-methods/index.mjs +11 -0
  277. package/dist/internals/simulation/middleware/internal-methods/index.mjs.map +1 -0
  278. package/dist/internals/simulation/middleware/internal-methods/middleware.js +10 -0
  279. package/dist/internals/simulation/middleware/internal-methods/middleware.js.map +1 -0
  280. package/dist/internals/simulation/middleware/internal-methods/middleware.mjs +10 -0
  281. package/dist/internals/simulation/middleware/internal-methods/middleware.mjs.map +1 -0
  282. package/dist/internals/simulation/middleware/internal-methods/provider-state.js +8 -0
  283. package/dist/internals/simulation/middleware/internal-methods/provider-state.js.map +1 -0
  284. package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs +8 -0
  285. package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs.map +1 -0
  286. package/dist/internals/simulation/middleware/mock.js +9 -0
  287. package/dist/internals/simulation/middleware/mock.js.map +1 -0
  288. package/dist/internals/simulation/middleware/mock.mjs +9 -0
  289. package/dist/internals/simulation/middleware/mock.mjs.map +1 -0
  290. package/dist/internals/simulation/options.js +9 -0
  291. package/dist/internals/simulation/options.js.map +1 -0
  292. package/dist/internals/simulation/options.mjs +9 -0
  293. package/dist/internals/simulation/options.mjs.map +1 -0
  294. package/dist/internals/simulation/simulation.js +39 -0
  295. package/dist/internals/simulation/simulation.js.map +1 -0
  296. package/dist/internals/simulation/simulation.mjs +39 -0
  297. package/dist/internals/simulation/simulation.mjs.map +1 -0
  298. package/dist/internals/simulation/store/index.js +44 -0
  299. package/dist/internals/simulation/store/index.js.map +1 -0
  300. package/dist/internals/simulation/store/index.mjs +44 -0
  301. package/dist/internals/simulation/store/index.mjs.map +1 -0
  302. package/dist/internals/simulation/store/mocks.js +16 -0
  303. package/dist/internals/simulation/store/mocks.js.map +1 -0
  304. package/dist/internals/simulation/store/mocks.mjs +16 -0
  305. package/dist/internals/simulation/store/mocks.mjs.map +1 -0
  306. package/dist/internals/simulation/store/notifications.js +16 -0
  307. package/dist/internals/simulation/store/notifications.js.map +1 -0
  308. package/dist/internals/simulation/store/notifications.mjs +16 -0
  309. package/dist/internals/simulation/store/notifications.mjs.map +1 -0
  310. package/dist/internals/simulation/store/state.js +14 -0
  311. package/dist/internals/simulation/store/state.js.map +1 -0
  312. package/dist/internals/simulation/store/state.mjs +14 -0
  313. package/dist/internals/simulation/store/state.mjs.map +1 -0
  314. package/dist/internals/simulation/store/store.js +12 -0
  315. package/dist/internals/simulation/store/store.js.map +1 -0
  316. package/dist/internals/simulation/store/store.mjs +12 -0
  317. package/dist/internals/simulation/store/store.mjs.map +1 -0
  318. package/dist/internals/simulation/store/ui.js +16 -0
  319. package/dist/internals/simulation/store/ui.js.map +1 -0
  320. package/dist/internals/simulation/store/ui.mjs +16 -0
  321. package/dist/internals/simulation/store/ui.mjs.map +1 -0
  322. package/dist/internals/structs.js +18 -0
  323. package/dist/internals/structs.js.map +1 -0
  324. package/dist/internals/structs.mjs +18 -0
  325. package/dist/internals/structs.mjs.map +1 -0
  326. package/dist/matchers.js +50 -0
  327. package/dist/matchers.js.map +1 -0
  328. package/dist/matchers.mjs +50 -0
  329. package/dist/matchers.mjs.map +1 -0
  330. package/dist/options.js +8 -0
  331. package/dist/options.js.map +1 -0
  332. package/dist/options.mjs +8 -0
  333. package/dist/options.mjs.map +1 -0
  334. package/dist/setup.js +39 -0
  335. package/dist/setup.js.map +1 -0
  336. package/dist/setup.mjs +39 -0
  337. package/dist/setup.mjs.map +1 -0
  338. package/dist/tsconfig.build.tsbuildinfo +1 -0
  339. package/dist/types/vendor/readable-stream.d.js +1 -0
  340. package/dist/types/vendor/readable-stream.d.js.map +1 -0
  341. package/dist/types/vendor/readable-stream.d.mjs +1 -0
  342. package/dist/types/vendor/readable-stream.d.mjs.map +1 -0
  343. package/dist/types.js +2 -0
  344. package/dist/types.js.map +1 -0
  345. package/dist/types.mjs +2 -0
  346. package/dist/types.mjs.map +1 -0
  347. package/jest-preset.js +1 -1
  348. package/package.json +24 -20
  349. package/dist/cjs/environment.js +0 -144
  350. package/dist/cjs/environment.js.map +0 -1
  351. package/dist/cjs/helpers.js +0 -142
  352. package/dist/cjs/helpers.js.map +0 -1
  353. package/dist/cjs/index.js +0 -42
  354. package/dist/cjs/index.js.map +0 -1
  355. package/dist/cjs/internals/environment.js +0 -19
  356. package/dist/cjs/internals/environment.js.map +0 -1
  357. package/dist/cjs/internals/index.js +0 -25
  358. package/dist/cjs/internals/index.js.map +0 -1
  359. package/dist/cjs/internals/logger.js +0 -14
  360. package/dist/cjs/internals/logger.js.map +0 -1
  361. package/dist/cjs/internals/request.js +0 -69
  362. package/dist/cjs/internals/request.js.map +0 -1
  363. package/dist/cjs/internals/server.js +0 -71
  364. package/dist/cjs/internals/server.js.map +0 -1
  365. package/dist/cjs/internals/simulation/constants.js +0 -29
  366. package/dist/cjs/internals/simulation/constants.js.map +0 -1
  367. package/dist/cjs/internals/simulation/controllers.js +0 -95
  368. package/dist/cjs/internals/simulation/controllers.js.map +0 -1
  369. package/dist/cjs/internals/simulation/files.js +0 -22
  370. package/dist/cjs/internals/simulation/files.js.map +0 -1
  371. package/dist/cjs/internals/simulation/index.js +0 -24
  372. package/dist/cjs/internals/simulation/index.js.map +0 -1
  373. package/dist/cjs/internals/simulation/interface.js +0 -98
  374. package/dist/cjs/internals/simulation/interface.js.map +0 -1
  375. package/dist/cjs/internals/simulation/methods/constants.js +0 -84
  376. package/dist/cjs/internals/simulation/methods/constants.js.map +0 -1
  377. package/dist/cjs/internals/simulation/methods/hooks/encryption.js +0 -33
  378. package/dist/cjs/internals/simulation/methods/hooks/encryption.js.map +0 -1
  379. package/dist/cjs/internals/simulation/methods/hooks/get-locale.js +0 -17
  380. package/dist/cjs/internals/simulation/methods/hooks/get-locale.js.map +0 -1
  381. package/dist/cjs/internals/simulation/methods/hooks/index.js +0 -25
  382. package/dist/cjs/internals/simulation/methods/hooks/index.js.map +0 -1
  383. package/dist/cjs/internals/simulation/methods/hooks/interface.js +0 -26
  384. package/dist/cjs/internals/simulation/methods/hooks/interface.js.map +0 -1
  385. package/dist/cjs/internals/simulation/methods/hooks/notifications.js +0 -66
  386. package/dist/cjs/internals/simulation/methods/hooks/notifications.js.map +0 -1
  387. package/dist/cjs/internals/simulation/methods/hooks/show-dialog.js +0 -43
  388. package/dist/cjs/internals/simulation/methods/hooks/state.js +0 -80
  389. package/dist/cjs/internals/simulation/methods/hooks/state.js.map +0 -1
  390. package/dist/cjs/internals/simulation/methods/index.js +0 -20
  391. package/dist/cjs/internals/simulation/methods/index.js.map +0 -1
  392. package/dist/cjs/internals/simulation/methods/specifications.js +0 -81
  393. package/dist/cjs/internals/simulation/methods/specifications.js.map +0 -1
  394. package/dist/cjs/internals/simulation/middleware/engine.js +0 -31
  395. package/dist/cjs/internals/simulation/middleware/engine.js.map +0 -1
  396. package/dist/cjs/internals/simulation/middleware/index.js +0 -20
  397. package/dist/cjs/internals/simulation/middleware/index.js.map +0 -1
  398. package/dist/cjs/internals/simulation/middleware/internal-methods/accounts.js +0 -30
  399. package/dist/cjs/internals/simulation/middleware/internal-methods/accounts.js.map +0 -1
  400. package/dist/cjs/internals/simulation/middleware/internal-methods/index.js +0 -20
  401. package/dist/cjs/internals/simulation/middleware/internal-methods/index.js.map +0 -1
  402. package/dist/cjs/internals/simulation/middleware/internal-methods/middleware.js +0 -37
  403. package/dist/cjs/internals/simulation/middleware/internal-methods/middleware.js.map +0 -1
  404. package/dist/cjs/internals/simulation/middleware/internal-methods/provider-state.js +0 -23
  405. package/dist/cjs/internals/simulation/middleware/internal-methods/provider-state.js.map +0 -1
  406. package/dist/cjs/internals/simulation/middleware/mock.js +0 -23
  407. package/dist/cjs/internals/simulation/middleware/mock.js.map +0 -1
  408. package/dist/cjs/internals/simulation/options.js +0 -24
  409. package/dist/cjs/internals/simulation/options.js.map +0 -1
  410. package/dist/cjs/internals/simulation/simulation.js +0 -124
  411. package/dist/cjs/internals/simulation/simulation.js.map +0 -1
  412. package/dist/cjs/internals/simulation/store/index.js +0 -23
  413. package/dist/cjs/internals/simulation/store/index.js.map +0 -1
  414. package/dist/cjs/internals/simulation/store/mocks.js +0 -52
  415. package/dist/cjs/internals/simulation/store/mocks.js.map +0 -1
  416. package/dist/cjs/internals/simulation/store/notifications.js +0 -52
  417. package/dist/cjs/internals/simulation/store/notifications.js.map +0 -1
  418. package/dist/cjs/internals/simulation/store/state.js +0 -64
  419. package/dist/cjs/internals/simulation/store/state.js.map +0 -1
  420. package/dist/cjs/internals/simulation/store/store.js +0 -57
  421. package/dist/cjs/internals/simulation/store/store.js.map +0 -1
  422. package/dist/cjs/internals/simulation/store/ui.js +0 -48
  423. package/dist/cjs/internals/simulation/store/ui.js.map +0 -1
  424. package/dist/cjs/internals/structs.js +0 -165
  425. package/dist/cjs/internals/structs.js.map +0 -1
  426. package/dist/cjs/matchers.js +0 -120
  427. package/dist/cjs/matchers.js.map +0 -1
  428. package/dist/cjs/options.js +0 -23
  429. package/dist/cjs/options.js.map +0 -1
  430. package/dist/cjs/setup.js +0 -10
  431. package/dist/cjs/setup.js.map +0 -1
  432. package/dist/cjs/types.js +0 -6
  433. package/dist/cjs/types.js.map +0 -1
  434. package/dist/esm/environment.js +0 -121
  435. package/dist/esm/environment.js.map +0 -1
  436. package/dist/esm/helpers.js +0 -163
  437. package/dist/esm/helpers.js.map +0 -1
  438. package/dist/esm/index.js +0 -6
  439. package/dist/esm/index.js.map +0 -1
  440. package/dist/esm/internals/environment.js +0 -14
  441. package/dist/esm/internals/environment.js.map +0 -1
  442. package/dist/esm/internals/index.js +0 -8
  443. package/dist/esm/internals/index.js.map +0 -1
  444. package/dist/esm/internals/logger.js +0 -4
  445. package/dist/esm/internals/logger.js.map +0 -1
  446. package/dist/esm/internals/request.js +0 -77
  447. package/dist/esm/internals/request.js.map +0 -1
  448. package/dist/esm/internals/server.js +0 -64
  449. package/dist/esm/internals/server.js.map +0 -1
  450. package/dist/esm/internals/simulation/constants.js +0 -12
  451. package/dist/esm/internals/simulation/constants.js.map +0 -1
  452. package/dist/esm/internals/simulation/controllers.js +0 -90
  453. package/dist/esm/internals/simulation/controllers.js.map +0 -1
  454. package/dist/esm/internals/simulation/files.js +0 -19
  455. package/dist/esm/internals/simulation/files.js.map +0 -1
  456. package/dist/esm/internals/simulation/index.js +0 -7
  457. package/dist/esm/internals/simulation/index.js.map +0 -1
  458. package/dist/esm/internals/simulation/interface.js +0 -95
  459. package/dist/esm/internals/simulation/interface.js.map +0 -1
  460. package/dist/esm/internals/simulation/methods/constants.js +0 -69
  461. package/dist/esm/internals/simulation/methods/constants.js.map +0 -1
  462. package/dist/esm/internals/simulation/methods/hooks/encryption.js +0 -39
  463. package/dist/esm/internals/simulation/methods/hooks/encryption.js.map +0 -1
  464. package/dist/esm/internals/simulation/methods/hooks/get-locale.js +0 -13
  465. package/dist/esm/internals/simulation/methods/hooks/get-locale.js.map +0 -1
  466. package/dist/esm/internals/simulation/methods/hooks/index.js +0 -8
  467. package/dist/esm/internals/simulation/methods/hooks/index.js.map +0 -1
  468. package/dist/esm/internals/simulation/methods/hooks/interface.js +0 -18
  469. package/dist/esm/internals/simulation/methods/hooks/interface.js.map +0 -1
  470. package/dist/esm/internals/simulation/methods/hooks/notifications.js +0 -58
  471. package/dist/esm/internals/simulation/methods/hooks/notifications.js.map +0 -1
  472. package/dist/esm/internals/simulation/methods/hooks/show-dialog.js +0 -38
  473. package/dist/esm/internals/simulation/methods/hooks/show-dialog.js.map +0 -1
  474. package/dist/esm/internals/simulation/methods/hooks/state.js +0 -74
  475. package/dist/esm/internals/simulation/methods/hooks/state.js.map +0 -1
  476. package/dist/esm/internals/simulation/methods/index.js +0 -3
  477. package/dist/esm/internals/simulation/methods/index.js.map +0 -1
  478. package/dist/esm/internals/simulation/methods/specifications.js +0 -84
  479. package/dist/esm/internals/simulation/methods/specifications.js.map +0 -1
  480. package/dist/esm/internals/simulation/middleware/engine.js +0 -33
  481. package/dist/esm/internals/simulation/middleware/engine.js.map +0 -1
  482. package/dist/esm/internals/simulation/middleware/index.js +0 -3
  483. package/dist/esm/internals/simulation/middleware/index.js.map +0 -1
  484. package/dist/esm/internals/simulation/middleware/internal-methods/accounts.js +0 -31
  485. package/dist/esm/internals/simulation/middleware/internal-methods/accounts.js.map +0 -1
  486. package/dist/esm/internals/simulation/middleware/internal-methods/index.js +0 -3
  487. package/dist/esm/internals/simulation/middleware/internal-methods/index.js.map +0 -1
  488. package/dist/esm/internals/simulation/middleware/internal-methods/middleware.js +0 -37
  489. package/dist/esm/internals/simulation/middleware/internal-methods/middleware.js.map +0 -1
  490. package/dist/esm/internals/simulation/middleware/internal-methods/provider-state.js +0 -23
  491. package/dist/esm/internals/simulation/middleware/internal-methods/provider-state.js.map +0 -1
  492. package/dist/esm/internals/simulation/middleware/mock.js +0 -18
  493. package/dist/esm/internals/simulation/middleware/mock.js.map +0 -1
  494. package/dist/esm/internals/simulation/options.js +0 -20
  495. package/dist/esm/internals/simulation/options.js.map +0 -1
  496. package/dist/esm/internals/simulation/simulation.js +0 -128
  497. package/dist/esm/internals/simulation/simulation.js.map +0 -1
  498. package/dist/esm/internals/simulation/store/index.js +0 -6
  499. package/dist/esm/internals/simulation/store/index.js.map +0 -1
  500. package/dist/esm/internals/simulation/store/mocks.js +0 -32
  501. package/dist/esm/internals/simulation/store/mocks.js.map +0 -1
  502. package/dist/esm/internals/simulation/store/notifications.js +0 -30
  503. package/dist/esm/internals/simulation/store/notifications.js.map +0 -1
  504. package/dist/esm/internals/simulation/store/state.js +0 -47
  505. package/dist/esm/internals/simulation/store/state.js.map +0 -1
  506. package/dist/esm/internals/simulation/store/store.js +0 -50
  507. package/dist/esm/internals/simulation/store/store.js.map +0 -1
  508. package/dist/esm/internals/simulation/store/ui.js +0 -21
  509. package/dist/esm/internals/simulation/store/ui.js.map +0 -1
  510. package/dist/esm/internals/structs.js +0 -135
  511. package/dist/esm/internals/structs.js.map +0 -1
  512. package/dist/esm/matchers.js +0 -111
  513. package/dist/esm/matchers.js.map +0 -1
  514. package/dist/esm/options.js +0 -20
  515. package/dist/esm/options.js.map +0 -1
  516. package/dist/esm/setup.js +0 -6
  517. package/dist/esm/setup.js.map +0 -1
  518. package/dist/esm/types.js +0 -3
  519. package/dist/esm/types.js.map +0 -1
@@ -1,111 +0,0 @@
1
- /* eslint-disable no-invalid-this */ // Note: Because this file imports from `@jest/globals`, it can only be used in
2
- // a Jest environment. This is why it's not exported from the index file.
3
- import { expect } from '@jest/globals';
4
- import { hasProperty } from '@metamask/utils';
5
- import { diff, matcherErrorMessage, matcherHint, printReceived, printWithType, RECEIVED_COLOR } from 'jest-matcher-utils';
6
- import { is } from 'superstruct';
7
- import { InterfaceStruct, SnapResponseStruct } from './internals';
8
- /**
9
- * Ensure that the actual value is a response from the `request` function.
10
- *
11
- * @param actual - The actual value.
12
- * @param matcherName - The name of the matcher.
13
- * @param options - The matcher options.
14
- */ function assertActualIsSnapResponse(actual, matcherName, options) {
15
- if (!is(actual, SnapResponseStruct)) {
16
- throw new Error(matcherErrorMessage(matcherHint(matcherName, undefined, undefined, options), `${RECEIVED_COLOR('received')} value must be a response from the \`request\` function`, printWithType('Received', actual, printReceived)));
17
- }
18
- }
19
- /**
20
- * Ensure that the actual value is a response from the `request` function, and
21
- * that it has a `ui` property.
22
- *
23
- * @param actual - The actual value.
24
- * @param matcherName - The name of the matcher.
25
- * @param options - The matcher options.
26
- */ function assertHasInterface(actual, matcherName, options) {
27
- if (!is(actual, InterfaceStruct) || !actual.content) {
28
- throw new Error(matcherErrorMessage(matcherHint(matcherName, undefined, undefined, options), `${RECEIVED_COLOR('received')} value must have a \`content\` property`, printWithType('Received', actual, printReceived)));
29
- }
30
- }
31
- /**
32
- * Check if a JSON-RPC response matches the expected value. This matcher is
33
- * intended to be used with the `expect` global.
34
- *
35
- * @param actual - The actual response.
36
- * @param expected - The expected response.
37
- * @returns The status and message.
38
- */ export const toRespondWith = function(actual, expected) {
39
- assertActualIsSnapResponse(actual, 'toRespondWith');
40
- const { response } = actual;
41
- if (hasProperty(response, 'error')) {
42
- const message = ()=>`${this.utils.matcherHint('.toRespondWith')}\n\n` + `Expected response: ${this.utils.printExpected(expected)}\n` + `Received error: ${this.utils.printReceived(response.error)}`;
43
- return {
44
- message,
45
- pass: false
46
- };
47
- }
48
- const pass = this.equals(response.result, expected);
49
- const message = pass ? ()=>`${this.utils.matcherHint('.not.toRespondWith')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Received: ${this.utils.printReceived(response.result)}` : ()=>`${this.utils.matcherHint('.toRespondWith')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Received: ${this.utils.printReceived(response.result)}`;
50
- return {
51
- message,
52
- pass
53
- };
54
- };
55
- export const toRespondWithError = function(actual, expected) {
56
- assertActualIsSnapResponse(actual, 'toRespondWithError');
57
- const { response } = actual;
58
- if (hasProperty(response, 'result')) {
59
- const message = ()=>`${this.utils.matcherHint('.toRespondWithError')}\n\n` + `Expected error: ${this.utils.printExpected(expected)}\n` + `Received result: ${this.utils.printReceived(response.result)}`;
60
- return {
61
- message,
62
- pass: false
63
- };
64
- }
65
- const pass = this.equals(response.error, expected);
66
- const message = pass ? ()=>`${this.utils.matcherHint('.not.toRespondWithError')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Received: ${this.utils.printReceived(response.error)}` : ()=>`${this.utils.matcherHint('.toRespondWithError')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Received: ${this.utils.printReceived(response.error)}`;
67
- return {
68
- message,
69
- pass
70
- };
71
- };
72
- /**
73
- * Check if the snap sent a notification with the expected message. This matcher
74
- * is intended to be used with the `expect` global.
75
- *
76
- * @param actual - The actual response.
77
- * @param expected - The expected notification message.
78
- * @param type - The expected notification type.
79
- * @returns The status and message.
80
- */ export const toSendNotification = function(actual, expected, type) {
81
- assertActualIsSnapResponse(actual, 'toSendNotification');
82
- const { notifications } = actual;
83
- const pass = notifications.some((notification)=>this.equals(notification.message, expected) && (type === undefined || notification.type === type));
84
- const message = pass ? ()=>`${this.utils.matcherHint('.not.toSendNotification')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Expected type: ${this.utils.printExpected(type)}\n` + `Received: ${this.utils.printReceived(notifications)}` : ()=>`${this.utils.matcherHint('.toSendNotification')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Expected type: ${this.utils.printExpected(type)}\n` + `Received: ${this.utils.printReceived(notifications)}`;
85
- return {
86
- message,
87
- pass
88
- };
89
- };
90
- export const toRender = function(actual, expected) {
91
- assertHasInterface(actual, 'toRender');
92
- const { content } = actual;
93
- const pass = this.equals(content, expected);
94
- // This is typed as `string | null`, but in practice it's always a string. The
95
- // function only returns `null` if both the expected and actual values are
96
- // numbers, bigints, or booleans, which is never the case here.
97
- const difference = diff(expected, content);
98
- const message = pass ? ()=>`${this.utils.matcherHint('.not.toRender')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Received: ${this.utils.printReceived(content)}` + `\n\nDifference:\n\n${difference}` : ()=>`${this.utils.matcherHint('.toRender')}\n\n` + `Expected: ${this.utils.printExpected(expected)}\n` + `Received: ${this.utils.printReceived(content)}` + `\n\nDifference:\n\n${difference}`;
99
- return {
100
- message,
101
- pass
102
- };
103
- };
104
- expect.extend({
105
- toRespondWith,
106
- toRespondWithError,
107
- toSendNotification,
108
- toRender
109
- });
110
-
111
- //# sourceMappingURL=matchers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/matchers.ts"],"sourcesContent":["/* eslint-disable no-invalid-this */\n\n// Note: Because this file imports from `@jest/globals`, it can only be used in\n// a Jest environment. This is why it's not exported from the index file.\n\nimport type { MatcherFunction } from '@jest/expect';\nimport { expect } from '@jest/globals';\nimport type {\n NotificationType,\n EnumToUnion,\n Component,\n} from '@metamask/snaps-sdk';\nimport type { Json } from '@metamask/utils';\nimport { hasProperty } from '@metamask/utils';\nimport type { MatcherHintOptions } from 'jest-matcher-utils';\nimport {\n diff,\n matcherErrorMessage,\n matcherHint,\n printReceived,\n printWithType,\n RECEIVED_COLOR,\n} from 'jest-matcher-utils';\nimport { is } from 'superstruct';\n\nimport { InterfaceStruct, SnapResponseStruct } from './internals';\nimport type { SnapResponse } from './types';\n\n/**\n * Ensure that the actual value is a response from the `request` function.\n *\n * @param actual - The actual value.\n * @param matcherName - The name of the matcher.\n * @param options - The matcher options.\n */\nfunction assertActualIsSnapResponse(\n actual: unknown,\n matcherName: string,\n options?: MatcherHintOptions,\n): asserts actual is SnapResponse {\n if (!is(actual, SnapResponseStruct)) {\n throw new Error(\n matcherErrorMessage(\n matcherHint(matcherName, undefined, undefined, options),\n `${RECEIVED_COLOR(\n 'received',\n )} value must be a response from the \\`request\\` function`,\n printWithType('Received', actual, printReceived),\n ),\n );\n }\n}\n\n/**\n * Ensure that the actual value is a response from the `request` function, and\n * that it has a `ui` property.\n *\n * @param actual - The actual value.\n * @param matcherName - The name of the matcher.\n * @param options - The matcher options.\n */\nfunction assertHasInterface(\n actual: unknown,\n matcherName: string,\n options?: MatcherHintOptions,\n): asserts actual is { content: Component } {\n if (!is(actual, InterfaceStruct) || !actual.content) {\n throw new Error(\n matcherErrorMessage(\n matcherHint(matcherName, undefined, undefined, options),\n `${RECEIVED_COLOR('received')} value must have a \\`content\\` property`,\n printWithType('Received', actual, printReceived),\n ),\n );\n }\n}\n\n/**\n * Check if a JSON-RPC response matches the expected value. This matcher is\n * intended to be used with the `expect` global.\n *\n * @param actual - The actual response.\n * @param expected - The expected response.\n * @returns The status and message.\n */\nexport const toRespondWith: MatcherFunction<[expected: Json]> = function (\n actual,\n expected,\n) {\n assertActualIsSnapResponse(actual, 'toRespondWith');\n\n const { response } = actual;\n if (hasProperty(response, 'error')) {\n const message = () =>\n `${this.utils.matcherHint('.toRespondWith')}\\n\\n` +\n `Expected response: ${this.utils.printExpected(expected)}\\n` +\n `Received error: ${this.utils.printReceived(response.error)}`;\n\n return { message, pass: false };\n }\n\n const pass = this.equals(response.result, expected);\n const message = pass\n ? () =>\n `${this.utils.matcherHint('.not.toRespondWith')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(response.result)}`\n : () =>\n `${this.utils.matcherHint('.toRespondWith')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(response.result)}`;\n\n return { message, pass };\n};\n\nexport const toRespondWithError: MatcherFunction<[expected: Json]> = function (\n actual,\n expected,\n) {\n assertActualIsSnapResponse(actual, 'toRespondWithError');\n\n const { response } = actual;\n if (hasProperty(response, 'result')) {\n const message = () =>\n `${this.utils.matcherHint('.toRespondWithError')}\\n\\n` +\n `Expected error: ${this.utils.printExpected(expected)}\\n` +\n `Received result: ${this.utils.printReceived(response.result)}`;\n\n return { message, pass: false };\n }\n\n const pass = this.equals(response.error, expected);\n const message = pass\n ? () =>\n `${this.utils.matcherHint('.not.toRespondWithError')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(response.error)}`\n : () =>\n `${this.utils.matcherHint('.toRespondWithError')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(response.error)}`;\n\n return { message, pass };\n};\n\n/**\n * Check if the snap sent a notification with the expected message. This matcher\n * is intended to be used with the `expect` global.\n *\n * @param actual - The actual response.\n * @param expected - The expected notification message.\n * @param type - The expected notification type.\n * @returns The status and message.\n */\nexport const toSendNotification: MatcherFunction<\n [expected: string, type?: EnumToUnion<NotificationType> | undefined]\n> = function (actual, expected, type) {\n assertActualIsSnapResponse(actual, 'toSendNotification');\n\n const { notifications } = actual;\n const pass = notifications.some(\n (notification) =>\n this.equals(notification.message, expected) &&\n (type === undefined || notification.type === type),\n );\n\n const message = pass\n ? () =>\n `${this.utils.matcherHint('.not.toSendNotification')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Expected type: ${this.utils.printExpected(type)}\\n` +\n `Received: ${this.utils.printReceived(notifications)}`\n : () =>\n `${this.utils.matcherHint('.toSendNotification')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Expected type: ${this.utils.printExpected(type)}\\n` +\n `Received: ${this.utils.printReceived(notifications)}`;\n\n return { message, pass };\n};\n\nexport const toRender: MatcherFunction<[expected: Component]> = function (\n actual,\n expected,\n) {\n assertHasInterface(actual, 'toRender');\n\n const { content } = actual;\n const pass = this.equals(content, expected);\n\n // This is typed as `string | null`, but in practice it's always a string. The\n // function only returns `null` if both the expected and actual values are\n // numbers, bigints, or booleans, which is never the case here.\n const difference = diff(expected, content);\n\n const message = pass\n ? () =>\n `${this.utils.matcherHint('.not.toRender')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(content)}` +\n `\\n\\nDifference:\\n\\n${difference as string}`\n : () =>\n `${this.utils.matcherHint('.toRender')}\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(content)}` +\n `\\n\\nDifference:\\n\\n${difference as string}`;\n\n return { message, pass };\n};\n\nexpect.extend({\n toRespondWith,\n toRespondWithError,\n toSendNotification,\n toRender,\n});\n"],"names":["expect","hasProperty","diff","matcherErrorMessage","matcherHint","printReceived","printWithType","RECEIVED_COLOR","is","InterfaceStruct","SnapResponseStruct","assertActualIsSnapResponse","actual","matcherName","options","Error","undefined","assertHasInterface","content","toRespondWith","expected","response","message","utils","printExpected","error","pass","equals","result","toRespondWithError","toSendNotification","type","notifications","some","notification","toRender","difference","extend"],"mappings":"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"}
@@ -1,20 +0,0 @@
1
- import { boolean, create, defaulted, number, object, string, type } from 'superstruct';
2
- const SnapsEnvironmentOptionsStruct = type({
3
- server: defaulted(object({
4
- enabled: defaulted(boolean(), true),
5
- port: defaulted(number(), 0),
6
- root: defaulted(string(), process.cwd())
7
- }), {})
8
- });
9
- /**
10
- * Get the environment options. This validates the options, and returns the
11
- * default options if none are provided.
12
- *
13
- * @param testEnvironmentOptions - The test environment options as defined in
14
- * the Jest configuration.
15
- * @returns The environment options.
16
- */ export function getOptions(testEnvironmentOptions) {
17
- return create(testEnvironmentOptions, SnapsEnvironmentOptionsStruct);
18
- }
19
-
20
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/options.ts"],"sourcesContent":["import type { Infer } from 'superstruct';\nimport {\n boolean,\n create,\n defaulted,\n number,\n object,\n string,\n type,\n} from 'superstruct';\n\nconst SnapsEnvironmentOptionsStruct = type({\n server: defaulted(\n object({\n enabled: defaulted(boolean(), true),\n port: defaulted(number(), 0),\n root: defaulted(string(), process.cwd()),\n }),\n {},\n ),\n});\n\n/**\n * The options for the environment. These can be specified in the Jest\n * configuration under `testEnvironmentOptions`.\n *\n * @example\n * {\n * \"testEnvironment\": \"@metamask/snaps-jest\",\n * \"testEnvironmentOptions\": {\n * \"executionEnvironmentUrl\": \"http://localhost:8080\",\n * \"server\": {\n * \"port\": 8080,\n * /* ... *\\/\n * }\n * }\n * }\n * @property server - The options for the built-in HTTP server.\n * @property server.enabled - Whether to run the built-in HTTP server. Defaults\n * to `true`.\n * @property server.port - The port to use for the built-in HTTP server. If this\n * is not provided, a random available port will be used.\n * @property server.root - The root directory to serve from the built-in HTTP\n * server. Defaults to the current working directory. This is assumed to be the\n * directory containing the snap manifest and `dist` files. If this is a\n * relative path, it will be resolved relative to the current working directory.\n */\nexport type SnapsEnvironmentOptions = Infer<\n typeof SnapsEnvironmentOptionsStruct\n>;\n\n/**\n * Get the environment options. This validates the options, and returns the\n * default options if none are provided.\n *\n * @param testEnvironmentOptions - The test environment options as defined in\n * the Jest configuration.\n * @returns The environment options.\n */\nexport function getOptions(testEnvironmentOptions: Record<string, unknown>) {\n return create(testEnvironmentOptions, SnapsEnvironmentOptionsStruct);\n}\n"],"names":["boolean","create","defaulted","number","object","string","type","SnapsEnvironmentOptionsStruct","server","enabled","port","root","process","cwd","getOptions","testEnvironmentOptions"],"mappings":"AACA,SACEA,OAAO,EACPC,MAAM,EACNC,SAAS,EACTC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,IAAI,QACC,cAAc;AAErB,MAAMC,gCAAgCD,KAAK;IACzCE,QAAQN,UACNE,OAAO;QACLK,SAASP,UAAUF,WAAW;QAC9BU,MAAMR,UAAUC,UAAU;QAC1BQ,MAAMT,UAAUG,UAAUO,QAAQC,GAAG;IACvC,IACA,CAAC;AAEL;AA+BA;;;;;;;CAOC,GACD,OAAO,SAASC,WAAWC,sBAA+C;IACxE,OAAOd,OAAOc,wBAAwBR;AACxC"}
package/dist/esm/setup.js DELETED
@@ -1,6 +0,0 @@
1
- // Setup file for Jest. This file is used in the Jest preset configuration, and
2
- // not intended to be exported or used directly.
3
- // eslint-disable-next-line import/no-unassigned-import
4
- import './matchers';
5
-
6
- //# sourceMappingURL=setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/setup.ts"],"sourcesContent":["// Setup file for Jest. This file is used in the Jest preset configuration, and\n// not intended to be exported or used directly.\n\n// eslint-disable-next-line import/no-unassigned-import\nimport './matchers';\n"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gDAAgD;AAEhD,uDAAuD;AACvD,OAAO,aAAa"}
package/dist/esm/types.js DELETED
@@ -1,3 +0,0 @@
1
- export { };
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types.ts"],"sourcesContent":["import type {\n NotificationType,\n EnumToUnion,\n Component,\n} from '@metamask/snaps-sdk';\nimport type { Json, JsonRpcId, JsonRpcParams } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\n\nimport type {\n SignatureOptionsStruct,\n SnapOptionsStruct,\n SnapResponseStruct,\n TransactionOptionsStruct,\n} from './internals';\n\n/* eslint-disable @typescript-eslint/consistent-type-definitions */\ndeclare module 'expect' {\n interface AsymmetricMatchers {\n toRespondWith(response: unknown): void;\n toRespondWithError(error: unknown): void;\n toSendNotification(\n message: string,\n type?: EnumToUnion<NotificationType>,\n ): void;\n toRender(component: Component): void;\n }\n\n // Ideally we would use `Matchers<Result>` instead of `Matchers<R>`, but\n // TypeScript doesn't allow this:\n // TS2428: All declarations of 'Matchers' must have identical type parameters.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n interface Matchers<R> {\n toRespondWith(response: unknown): R;\n toRespondWithError(error: unknown): R;\n toSendNotification(\n message: string,\n type?: EnumToUnion<NotificationType>,\n ): R;\n toRender(component: Component): R;\n }\n}\n/* eslint-enable @typescript-eslint/consistent-type-definitions */\n\nexport type RequestOptions = {\n /**\n * The JSON-RPC request ID.\n */\n id?: JsonRpcId;\n\n /**\n * The JSON-RPC method.\n */\n method: string;\n\n /**\n * The JSON-RPC params.\n */\n params?: JsonRpcParams;\n\n /**\n * The origin to send the request from.\n */\n origin?: string;\n};\n\n/**\n * The `runCronjob` options. This is the same as {@link RequestOptions}, except\n * that it does not have an `origin` property.\n */\nexport type CronjobOptions = Omit<RequestOptions, 'origin'>;\n\n/**\n * The options to use for transaction requests.\n *\n * @property chainId - The CAIP-2 chain ID to send the transaction on. Defaults\n * to `eip155:1`.\n * @property origin - The origin to send the transaction from. Defaults to\n * `metamask.io`.\n * @property from - The address to send the transaction from. Defaults to a\n * randomly generated address.\n * @property to - The address to send the transaction to. Defaults to a randomly\n * generated address.\n * @property value - The value to send with the transaction. Defaults to `0`.\n * @property data - The data to send with the transaction. Defaults to `0x`.\n * @property gasLimit - The gas limit to use for the transaction. Defaults to\n * `21_000`.\n * @property maxFeePerGas - The maximum fee per gas to use for the transaction.\n * Defaults to `1`.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas to use for\n * the transaction. Defaults to `1`.\n * @property nonce - The nonce to use for the transaction. Defaults to `0`.\n */\nexport type TransactionOptions = Infer<typeof TransactionOptionsStruct>;\n\n/**\n * The options to use for signature requests.\n *\n * @property origin - The origin to send the signature request from. Defaults to\n * `metamask.io`.\n * @property from - The address to send the signature from. Defaults to a\n * randomly generated address.\n * @property data - The data to sign. Defaults to `0x`.\n * @property signatureMethod - The signature method.\n */\nexport type SignatureOptions = Infer<typeof SignatureOptionsStruct>;\n\n/**\n * The options to use for requests to the snap.\n *\n * @property timeout - The timeout in milliseconds to use. Defaults to `1000`.\n */\nexport type SnapOptions = Infer<typeof SnapOptionsStruct>;\n\n/**\n * A `snap_dialog` alert interface.\n */\nexport type SnapAlertInterface = {\n /**\n * The type of the interface. This is always `alert`.\n */\n type: 'alert';\n\n /**\n * The content to show in the alert.\n */\n content: Component;\n\n /**\n * Close the alert.\n */\n ok(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` confirmation interface.\n */\nexport type SnapConfirmationInterface = {\n /**\n * The type of the interface. This is always `confirmation`.\n */\n type: 'confirmation';\n\n /**\n * The content to show in the confirmation.\n */\n content: Component;\n\n /**\n * Close the confirmation.\n */\n ok(): Promise<void>;\n\n /**\n * Cancel the confirmation.\n */\n cancel(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` prompt interface.\n */\nexport type SnapPromptInterface = {\n /**\n * The type of the interface. This is always `prompt`.\n */\n type: 'prompt';\n\n /**\n * The content to show in the prompt.\n */\n content: Component;\n\n /**\n * Close the prompt.\n *\n * @param value - The value to close the prompt with.\n */\n ok(value?: string): Promise<void>;\n\n /**\n * Cancel the prompt.\n */\n cancel(): Promise<void>;\n};\n\nexport type SnapInterface =\n | SnapAlertInterface\n | SnapConfirmationInterface\n | SnapPromptInterface;\n\nexport type SnapRequestObject = {\n /**\n * Get a user interface object from a snap. This will throw an error if the\n * snap does not show a user interface within the timeout.\n *\n * @param options - The options to use.\n * @param options.timeout - The timeout in milliseconds to use. Defaults to\n * `1000`.\n * @returns The user interface object.\n */\n getInterface(options?: SnapOptions): Promise<SnapInterface>;\n};\n\n/**\n * A pending request object. This is a promise with extra\n * {@link SnapRequestObject} fields.\n */\nexport type SnapRequest = Promise<SnapResponse> & SnapRequestObject;\n\n/**\n * The options to use for mocking a JSON-RPC request.\n */\nexport type JsonRpcMockOptions = {\n /**\n * The JSON-RPC request method.\n */\n method: string;\n\n /**\n * The JSON-RPC response, which will be returned when a request with the\n * specified method is sent.\n */\n result: Json;\n};\n\n/**\n * This is the main entry point to interact with the snap. It is returned by\n * {@link installSnap}, and has methods to send requests to the snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * const snap = await installSnap();\n * const response = await snap.request({ method: 'hello' });\n *\n * expect(response).toRespondWith('Hello, world!');\n */\nexport type Snap = {\n /**\n * Send a JSON-RPC request to the snap.\n *\n * @param request - The request. This is similar to a JSON-RPC request, but\n * has an extra `origin` field.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n request(request: RequestOptions): SnapRequest;\n\n /**\n * Send a transaction to the snap.\n *\n * @param transaction - The transaction. This is similar to an Ethereum\n * transaction object, but has an extra `origin` field. Any missing fields\n * will be filled in with default values.\n * @returns The response.\n */\n onTransaction(\n transaction?: Partial<TransactionOptions>,\n ): Promise<SnapResponse>;\n\n /**\n * Send a transaction to the snap.\n *\n * @param transaction - The transaction. This is similar to an Ethereum\n * transaction object, but has an extra `origin` field. Any missing fields\n * will be filled in with default values.\n * @returns The response.\n * @deprecated Use {@link onTransaction} instead.\n */\n sendTransaction(\n transaction?: Partial<TransactionOptions>,\n ): Promise<SnapResponse>;\n\n /**\n * Send a signature request to the snap.\n *\n * @param signature - The signature request object. Contains the params from\n * the various signature methods, but has an extra `origin` and `signatureMethod` field.\n * Any missing fields will be filled in with default values.\n * @returns The response.\n */\n onSignature(signature?: Partial<SignatureOptions>): Promise<SnapResponse>;\n\n /**\n * Run a cronjob in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param cronjob - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified in the snap manifest, under the\n * `endowment:cronjob` permission.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onCronjob(cronjob?: Partial<CronjobOptions>): SnapRequest;\n\n /**\n * Run a cronjob in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param cronjob - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified in the snap manifest, under the\n * `endowment:cronjob` permission.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n * @deprecated Use {@link onCronjob} instead.\n */\n runCronjob(cronjob: CronjobOptions): SnapRequest;\n\n /**\n * Get the response from the snap's `onHomePage` method.\n *\n * @returns The response.\n */\n onHomePage(): Promise<SnapResponse>;\n\n /**\n * Mock a JSON-RPC request. This will cause the snap to respond with the\n * specified response when a request with the specified method is sent.\n *\n * @param mock - The mock options.\n * @param mock.method - The JSON-RPC request method.\n * @param mock.result - The JSON-RPC response, which will be returned when a\n * request with the specified method is sent.\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * // In the test\n * const snap = await installSnap();\n * snap.mockJsonRpc({ method: 'eth_accounts', result: ['0x1234'] });\n *\n * // In the Snap\n * const response =\n * await ethereum.request({ method: 'eth_accounts' }); // ['0x1234']\n */\n mockJsonRpc(mock: JsonRpcMockOptions): {\n /**\n * Remove the mock.\n */\n unmock(): void;\n };\n\n /**\n * Close the page running the snap. This is mainly useful for cleaning up\n * the test environment, and calling it is not strictly necessary.\n *\n * @returns A promise that resolves when the page is closed.\n * @deprecated Snaps are now automatically closed when the test ends. This\n * method will be removed in a future release.\n */\n close(): Promise<void>;\n};\n\nexport type SnapResponse = Infer<typeof SnapResponseStruct>;\n"],"names":[],"mappings":"AAAA,WA6V4D"}