It looks like this is a web page, not a feed. I looked for a feed associated with this page, but couldn't find one. Please enter the address of your feed to validate.

Source: https://devhubby.com/thread/how-to-mock-exception-in-jest

  1. <!doctype html>
  2. <html data-n-head-ssr>
  3.  <head >
  4.    <meta data-n-head="ssr" charset="utf-8"><meta data-n-head="ssr" name="viewport" content="width=device-width, initial-scale=1"><meta data-n-head="ssr" property="twitter:site" content="@devhubbycom"><meta data-n-head="ssr" property="twitter:creator" content="@devhubbycom"><meta data-n-head="ssr" property="twitter:title" content="how to mock exception in jest?"><meta data-n-head="ssr" property="twitter:description" content="how to mock exception in jest?"><meta data-n-head="ssr" property="twitter:image" content="https://forum-static.fra1.cdn.digitaloceanspaces.com/images/c64c6733-bfad-4db8-b387-18207476d4d5/thread/2023/f0246946-66aa-4613-83e9-fdfc09ce8e6f.png"><meta data-n-head="ssr" property="twitter:card" content="summary_large_image"><meta data-n-head="ssr" property="og:title" content="how to mock exception in jest?"><meta data-n-head="ssr" property="og:url" content="https://devhubby.com/thread/how-to-mock-exception-in-jest"><meta data-n-head="ssr" property="og:image" content="https://forum-static.fra1.cdn.digitaloceanspaces.com/images/c64c6733-bfad-4db8-b387-18207476d4d5/thread/2023/f0246946-66aa-4613-83e9-fdfc09ce8e6f.png"><meta data-n-head="ssr" property="og:description" content="how to mock exception in jest?"><meta data-n-head="ssr" property="og:site_name" content="Software Developer Questions and Answers"><meta data-n-head="ssr" data-hid="description" name="description" content="how to mock exception in jest?"><title>how to mock exception in jest?</title><link data-n-head="ssr" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto"><link data-n-head="ssr" rel="stylesheet" href="https://forum-static.fra1.cdn.digitaloceanspaces.com/css/c64c6733-bfad-4db8-b387-18207476d4d5/custom.css"><link data-n-head="ssr" rel="icon" type="image/png" href="https://forum-static.fra1.cdn.digitaloceanspaces.com/images/c64c6733-bfad-4db8-b387-18207476d4d5/favicon.png"><link data-n-head="ssr" data-hid="i18n-can" rel="canonical" href="https://devhubby.com/thread/how-to-mock-exception-in-jest"><style data-n-head="vuetify" type="text/css" id="vuetify-theme-stylesheet" nonce="undefined">.v-application a { color: #ff6b00; }
  5. .v-application .primary {
  6.  background-color: #ff6b00 !important;
  7.  border-color: #ff6b00 !important;
  8. }
  9. .v-application .primary--text {
  10.  color: #ff6b00 !important;
  11.  caret-color: #ff6b00 !important;
  12. }
  13. .v-application .primary.lighten-5 {
  14.  background-color: #fff897 !important;
  15.  border-color: #fff897 !important;
  16. }
  17. .v-application .primary--text.text--lighten-5 {
  18.  color: #fff897 !important;
  19.  caret-color: #fff897 !important;
  20. }
  21. .v-application .primary.lighten-4 {
  22.  background-color: #ffdb7b !important;
  23.  border-color: #ffdb7b !important;
  24. }
  25. .v-application .primary--text.text--lighten-4 {
  26.  color: #ffdb7b !important;
  27.  caret-color: #ffdb7b !important;
  28. }
  29. .v-application .primary.lighten-3 {
  30.  background-color: #ffbe60 !important;
  31.  border-color: #ffbe60 !important;
  32. }
  33. .v-application .primary--text.text--lighten-3 {
  34.  color: #ffbe60 !important;
  35.  caret-color: #ffbe60 !important;
  36. }
  37. .v-application .primary.lighten-2 {
  38.  background-color: #ffa245 !important;
  39.  border-color: #ffa245 !important;
  40. }
  41. .v-application .primary--text.text--lighten-2 {
  42.  color: #ffa245 !important;
  43.  caret-color: #ffa245 !important;
  44. }
  45. .v-application .primary.lighten-1 {
  46.  background-color: #ff8629 !important;
  47.  border-color: #ff8629 !important;
  48. }
  49. .v-application .primary--text.text--lighten-1 {
  50.  color: #ff8629 !important;
  51.  caret-color: #ff8629 !important;
  52. }
  53. .v-application .primary.darken-1 {
  54.  background-color: #de5000 !important;
  55.  border-color: #de5000 !important;
  56. }
  57. .v-application .primary--text.text--darken-1 {
  58.  color: #de5000 !important;
  59.  caret-color: #de5000 !important;
  60. }
  61. .v-application .primary.darken-2 {
  62.  background-color: #be3400 !important;
  63.  border-color: #be3400 !important;
  64. }
  65. .v-application .primary--text.text--darken-2 {
  66.  color: #be3400 !important;
  67.  caret-color: #be3400 !important;
  68. }
  69. .v-application .primary.darken-3 {
  70.  background-color: #9f1100 !important;
  71.  border-color: #9f1100 !important;
  72. }
  73. .v-application .primary--text.text--darken-3 {
  74.  color: #9f1100 !important;
  75.  caret-color: #9f1100 !important;
  76. }
  77. .v-application .primary.darken-4 {
  78.  background-color: #810000 !important;
  79.  border-color: #810000 !important;
  80. }
  81. .v-application .primary--text.text--darken-4 {
  82.  color: #810000 !important;
  83.  caret-color: #810000 !important;
  84. }
  85. .v-application .secondary {
  86.  background-color: #0095ff !important;
  87.  border-color: #0095ff !important;
  88. }
  89. .v-application .secondary--text {
  90.  color: #0095ff !important;
  91.  caret-color: #0095ff !important;
  92. }
  93. .v-application .secondary.lighten-5 {
  94.  background-color: #d3ffff !important;
  95.  border-color: #d3ffff !important;
  96. }
  97. .v-application .secondary--text.text--lighten-5 {
  98.  color: #d3ffff !important;
  99.  caret-color: #d3ffff !important;
  100. }
  101. .v-application .secondary.lighten-4 {
  102.  background-color: #b3ffff !important;
  103.  border-color: #b3ffff !important;
  104. }
  105. .v-application .secondary--text.text--lighten-4 {
  106.  color: #b3ffff !important;
  107.  caret-color: #b3ffff !important;
  108. }
  109. .v-application .secondary.lighten-3 {
  110.  background-color: #92e6ff !important;
  111.  border-color: #92e6ff !important;
  112. }
  113. .v-application .secondary--text.text--lighten-3 {
  114.  color: #92e6ff !important;
  115.  caret-color: #92e6ff !important;
  116. }
  117. .v-application .secondary.lighten-2 {
  118.  background-color: #70cbff !important;
  119.  border-color: #70cbff !important;
  120. }
  121. .v-application .secondary--text.text--lighten-2 {
  122.  color: #70cbff !important;
  123.  caret-color: #70cbff !important;
  124. }
  125. .v-application .secondary.lighten-1 {
  126.  background-color: #49afff !important;
  127.  border-color: #49afff !important;
  128. }
  129. .v-application .secondary--text.text--lighten-1 {
  130.  color: #49afff !important;
  131.  caret-color: #49afff !important;
  132. }
  133. .v-application .secondary.darken-1 {
  134.  background-color: #007ce2 !important;
  135.  border-color: #007ce2 !important;
  136. }
  137. .v-application .secondary--text.text--darken-1 {
  138.  color: #007ce2 !important;
  139.  caret-color: #007ce2 !important;
  140. }
  141. .v-application .secondary.darken-2 {
  142.  background-color: #0063c6 !important;
  143.  border-color: #0063c6 !important;
  144. }
  145. .v-application .secondary--text.text--darken-2 {
  146.  color: #0063c6 !important;
  147.  caret-color: #0063c6 !important;
  148. }
  149. .v-application .secondary.darken-3 {
  150.  background-color: #004caa !important;
  151.  border-color: #004caa !important;
  152. }
  153. .v-application .secondary--text.text--darken-3 {
  154.  color: #004caa !important;
  155.  caret-color: #004caa !important;
  156. }
  157. .v-application .secondary.darken-4 {
  158.  background-color: #00368f !important;
  159.  border-color: #00368f !important;
  160. }
  161. .v-application .secondary--text.text--darken-4 {
  162.  color: #00368f !important;
  163.  caret-color: #00368f !important;
  164. }
  165. .v-application .accent {
  166.  background-color: #0095ff !important;
  167.  border-color: #0095ff !important;
  168. }
  169. .v-application .accent--text {
  170.  color: #0095ff !important;
  171.  caret-color: #0095ff !important;
  172. }
  173. .v-application .accent.lighten-5 {
  174.  background-color: #d3ffff !important;
  175.  border-color: #d3ffff !important;
  176. }
  177. .v-application .accent--text.text--lighten-5 {
  178.  color: #d3ffff !important;
  179.  caret-color: #d3ffff !important;
  180. }
  181. .v-application .accent.lighten-4 {
  182.  background-color: #b3ffff !important;
  183.  border-color: #b3ffff !important;
  184. }
  185. .v-application .accent--text.text--lighten-4 {
  186.  color: #b3ffff !important;
  187.  caret-color: #b3ffff !important;
  188. }
  189. .v-application .accent.lighten-3 {
  190.  background-color: #92e6ff !important;
  191.  border-color: #92e6ff !important;
  192. }
  193. .v-application .accent--text.text--lighten-3 {
  194.  color: #92e6ff !important;
  195.  caret-color: #92e6ff !important;
  196. }
  197. .v-application .accent.lighten-2 {
  198.  background-color: #70cbff !important;
  199.  border-color: #70cbff !important;
  200. }
  201. .v-application .accent--text.text--lighten-2 {
  202.  color: #70cbff !important;
  203.  caret-color: #70cbff !important;
  204. }
  205. .v-application .accent.lighten-1 {
  206.  background-color: #49afff !important;
  207.  border-color: #49afff !important;
  208. }
  209. .v-application .accent--text.text--lighten-1 {
  210.  color: #49afff !important;
  211.  caret-color: #49afff !important;
  212. }
  213. .v-application .accent.darken-1 {
  214.  background-color: #007ce2 !important;
  215.  border-color: #007ce2 !important;
  216. }
  217. .v-application .accent--text.text--darken-1 {
  218.  color: #007ce2 !important;
  219.  caret-color: #007ce2 !important;
  220. }
  221. .v-application .accent.darken-2 {
  222.  background-color: #0063c6 !important;
  223.  border-color: #0063c6 !important;
  224. }
  225. .v-application .accent--text.text--darken-2 {
  226.  color: #0063c6 !important;
  227.  caret-color: #0063c6 !important;
  228. }
  229. .v-application .accent.darken-3 {
  230.  background-color: #004caa !important;
  231.  border-color: #004caa !important;
  232. }
  233. .v-application .accent--text.text--darken-3 {
  234.  color: #004caa !important;
  235.  caret-color: #004caa !important;
  236. }
  237. .v-application .accent.darken-4 {
  238.  background-color: #00368f !important;
  239.  border-color: #00368f !important;
  240. }
  241. .v-application .accent--text.text--darken-4 {
  242.  color: #00368f !important;
  243.  caret-color: #00368f !important;
  244. }
  245. .v-application .error {
  246.  background-color: #ff6b00 !important;
  247.  border-color: #ff6b00 !important;
  248. }
  249. .v-application .error--text {
  250.  color: #ff6b00 !important;
  251.  caret-color: #ff6b00 !important;
  252. }
  253. .v-application .error.lighten-5 {
  254.  background-color: #fff897 !important;
  255.  border-color: #fff897 !important;
  256. }
  257. .v-application .error--text.text--lighten-5 {
  258.  color: #fff897 !important;
  259.  caret-color: #fff897 !important;
  260. }
  261. .v-application .error.lighten-4 {
  262.  background-color: #ffdb7b !important;
  263.  border-color: #ffdb7b !important;
  264. }
  265. .v-application .error--text.text--lighten-4 {
  266.  color: #ffdb7b !important;
  267.  caret-color: #ffdb7b !important;
  268. }
  269. .v-application .error.lighten-3 {
  270.  background-color: #ffbe60 !important;
  271.  border-color: #ffbe60 !important;
  272. }
  273. .v-application .error--text.text--lighten-3 {
  274.  color: #ffbe60 !important;
  275.  caret-color: #ffbe60 !important;
  276. }
  277. .v-application .error.lighten-2 {
  278.  background-color: #ffa245 !important;
  279.  border-color: #ffa245 !important;
  280. }
  281. .v-application .error--text.text--lighten-2 {
  282.  color: #ffa245 !important;
  283.  caret-color: #ffa245 !important;
  284. }
  285. .v-application .error.lighten-1 {
  286.  background-color: #ff8629 !important;
  287.  border-color: #ff8629 !important;
  288. }
  289. .v-application .error--text.text--lighten-1 {
  290.  color: #ff8629 !important;
  291.  caret-color: #ff8629 !important;
  292. }
  293. .v-application .error.darken-1 {
  294.  background-color: #de5000 !important;
  295.  border-color: #de5000 !important;
  296. }
  297. .v-application .error--text.text--darken-1 {
  298.  color: #de5000 !important;
  299.  caret-color: #de5000 !important;
  300. }
  301. .v-application .error.darken-2 {
  302.  background-color: #be3400 !important;
  303.  border-color: #be3400 !important;
  304. }
  305. .v-application .error--text.text--darken-2 {
  306.  color: #be3400 !important;
  307.  caret-color: #be3400 !important;
  308. }
  309. .v-application .error.darken-3 {
  310.  background-color: #9f1100 !important;
  311.  border-color: #9f1100 !important;
  312. }
  313. .v-application .error--text.text--darken-3 {
  314.  color: #9f1100 !important;
  315.  caret-color: #9f1100 !important;
  316. }
  317. .v-application .error.darken-4 {
  318.  background-color: #810000 !important;
  319.  border-color: #810000 !important;
  320. }
  321. .v-application .error--text.text--darken-4 {
  322.  color: #810000 !important;
  323.  caret-color: #810000 !important;
  324. }
  325. .v-application .info {
  326.  background-color: #0095ff !important;
  327.  border-color: #0095ff !important;
  328. }
  329. .v-application .info--text {
  330.  color: #0095ff !important;
  331.  caret-color: #0095ff !important;
  332. }
  333. .v-application .info.lighten-5 {
  334.  background-color: #d3ffff !important;
  335.  border-color: #d3ffff !important;
  336. }
  337. .v-application .info--text.text--lighten-5 {
  338.  color: #d3ffff !important;
  339.  caret-color: #d3ffff !important;
  340. }
  341. .v-application .info.lighten-4 {
  342.  background-color: #b3ffff !important;
  343.  border-color: #b3ffff !important;
  344. }
  345. .v-application .info--text.text--lighten-4 {
  346.  color: #b3ffff !important;
  347.  caret-color: #b3ffff !important;
  348. }
  349. .v-application .info.lighten-3 {
  350.  background-color: #92e6ff !important;
  351.  border-color: #92e6ff !important;
  352. }
  353. .v-application .info--text.text--lighten-3 {
  354.  color: #92e6ff !important;
  355.  caret-color: #92e6ff !important;
  356. }
  357. .v-application .info.lighten-2 {
  358.  background-color: #70cbff !important;
  359.  border-color: #70cbff !important;
  360. }
  361. .v-application .info--text.text--lighten-2 {
  362.  color: #70cbff !important;
  363.  caret-color: #70cbff !important;
  364. }
  365. .v-application .info.lighten-1 {
  366.  background-color: #49afff !important;
  367.  border-color: #49afff !important;
  368. }
  369. .v-application .info--text.text--lighten-1 {
  370.  color: #49afff !important;
  371.  caret-color: #49afff !important;
  372. }
  373. .v-application .info.darken-1 {
  374.  background-color: #007ce2 !important;
  375.  border-color: #007ce2 !important;
  376. }
  377. .v-application .info--text.text--darken-1 {
  378.  color: #007ce2 !important;
  379.  caret-color: #007ce2 !important;
  380. }
  381. .v-application .info.darken-2 {
  382.  background-color: #0063c6 !important;
  383.  border-color: #0063c6 !important;
  384. }
  385. .v-application .info--text.text--darken-2 {
  386.  color: #0063c6 !important;
  387.  caret-color: #0063c6 !important;
  388. }
  389. .v-application .info.darken-3 {
  390.  background-color: #004caa !important;
  391.  border-color: #004caa !important;
  392. }
  393. .v-application .info--text.text--darken-3 {
  394.  color: #004caa !important;
  395.  caret-color: #004caa !important;
  396. }
  397. .v-application .info.darken-4 {
  398.  background-color: #00368f !important;
  399.  border-color: #00368f !important;
  400. }
  401. .v-application .info--text.text--darken-4 {
  402.  color: #00368f !important;
  403.  caret-color: #00368f !important;
  404. }
  405. .v-application .success {
  406.  background-color: #0095ff !important;
  407.  border-color: #0095ff !important;
  408. }
  409. .v-application .success--text {
  410.  color: #0095ff !important;
  411.  caret-color: #0095ff !important;
  412. }
  413. .v-application .success.lighten-5 {
  414.  background-color: #d3ffff !important;
  415.  border-color: #d3ffff !important;
  416. }
  417. .v-application .success--text.text--lighten-5 {
  418.  color: #d3ffff !important;
  419.  caret-color: #d3ffff !important;
  420. }
  421. .v-application .success.lighten-4 {
  422.  background-color: #b3ffff !important;
  423.  border-color: #b3ffff !important;
  424. }
  425. .v-application .success--text.text--lighten-4 {
  426.  color: #b3ffff !important;
  427.  caret-color: #b3ffff !important;
  428. }
  429. .v-application .success.lighten-3 {
  430.  background-color: #92e6ff !important;
  431.  border-color: #92e6ff !important;
  432. }
  433. .v-application .success--text.text--lighten-3 {
  434.  color: #92e6ff !important;
  435.  caret-color: #92e6ff !important;
  436. }
  437. .v-application .success.lighten-2 {
  438.  background-color: #70cbff !important;
  439.  border-color: #70cbff !important;
  440. }
  441. .v-application .success--text.text--lighten-2 {
  442.  color: #70cbff !important;
  443.  caret-color: #70cbff !important;
  444. }
  445. .v-application .success.lighten-1 {
  446.  background-color: #49afff !important;
  447.  border-color: #49afff !important;
  448. }
  449. .v-application .success--text.text--lighten-1 {
  450.  color: #49afff !important;
  451.  caret-color: #49afff !important;
  452. }
  453. .v-application .success.darken-1 {
  454.  background-color: #007ce2 !important;
  455.  border-color: #007ce2 !important;
  456. }
  457. .v-application .success--text.text--darken-1 {
  458.  color: #007ce2 !important;
  459.  caret-color: #007ce2 !important;
  460. }
  461. .v-application .success.darken-2 {
  462.  background-color: #0063c6 !important;
  463.  border-color: #0063c6 !important;
  464. }
  465. .v-application .success--text.text--darken-2 {
  466.  color: #0063c6 !important;
  467.  caret-color: #0063c6 !important;
  468. }
  469. .v-application .success.darken-3 {
  470.  background-color: #004caa !important;
  471.  border-color: #004caa !important;
  472. }
  473. .v-application .success--text.text--darken-3 {
  474.  color: #004caa !important;
  475.  caret-color: #004caa !important;
  476. }
  477. .v-application .success.darken-4 {
  478.  background-color: #00368f !important;
  479.  border-color: #00368f !important;
  480. }
  481. .v-application .success--text.text--darken-4 {
  482.  color: #00368f !important;
  483.  caret-color: #00368f !important;
  484. }
  485. .v-application .warning {
  486.  background-color: #ff6b00 !important;
  487.  border-color: #ff6b00 !important;
  488. }
  489. .v-application .warning--text {
  490.  color: #ff6b00 !important;
  491.  caret-color: #ff6b00 !important;
  492. }
  493. .v-application .warning.lighten-5 {
  494.  background-color: #fff897 !important;
  495.  border-color: #fff897 !important;
  496. }
  497. .v-application .warning--text.text--lighten-5 {
  498.  color: #fff897 !important;
  499.  caret-color: #fff897 !important;
  500. }
  501. .v-application .warning.lighten-4 {
  502.  background-color: #ffdb7b !important;
  503.  border-color: #ffdb7b !important;
  504. }
  505. .v-application .warning--text.text--lighten-4 {
  506.  color: #ffdb7b !important;
  507.  caret-color: #ffdb7b !important;
  508. }
  509. .v-application .warning.lighten-3 {
  510.  background-color: #ffbe60 !important;
  511.  border-color: #ffbe60 !important;
  512. }
  513. .v-application .warning--text.text--lighten-3 {
  514.  color: #ffbe60 !important;
  515.  caret-color: #ffbe60 !important;
  516. }
  517. .v-application .warning.lighten-2 {
  518.  background-color: #ffa245 !important;
  519.  border-color: #ffa245 !important;
  520. }
  521. .v-application .warning--text.text--lighten-2 {
  522.  color: #ffa245 !important;
  523.  caret-color: #ffa245 !important;
  524. }
  525. .v-application .warning.lighten-1 {
  526.  background-color: #ff8629 !important;
  527.  border-color: #ff8629 !important;
  528. }
  529. .v-application .warning--text.text--lighten-1 {
  530.  color: #ff8629 !important;
  531.  caret-color: #ff8629 !important;
  532. }
  533. .v-application .warning.darken-1 {
  534.  background-color: #de5000 !important;
  535.  border-color: #de5000 !important;
  536. }
  537. .v-application .warning--text.text--darken-1 {
  538.  color: #de5000 !important;
  539.  caret-color: #de5000 !important;
  540. }
  541. .v-application .warning.darken-2 {
  542.  background-color: #be3400 !important;
  543.  border-color: #be3400 !important;
  544. }
  545. .v-application .warning--text.text--darken-2 {
  546.  color: #be3400 !important;
  547.  caret-color: #be3400 !important;
  548. }
  549. .v-application .warning.darken-3 {
  550.  background-color: #9f1100 !important;
  551.  border-color: #9f1100 !important;
  552. }
  553. .v-application .warning--text.text--darken-3 {
  554.  color: #9f1100 !important;
  555.  caret-color: #9f1100 !important;
  556. }
  557. .v-application .warning.darken-4 {
  558.  background-color: #810000 !important;
  559.  border-color: #810000 !important;
  560. }
  561. .v-application .warning--text.text--darken-4 {
  562.  color: #810000 !important;
  563.  caret-color: #810000 !important;
  564. }</style><link rel="preload" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/7b8ec9d.js" as="script"><link rel="preload" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/25edc65.js" as="script"><link rel="preload" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/css/1b7ab17.css" as="style"><link rel="preload" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/863688a.js" as="script"><link rel="preload" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/css/87b7056.css" as="style"><link rel="preload" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/cb42003.js" as="script"><link rel="stylesheet" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/css/1b7ab17.css"><link rel="stylesheet" href="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/css/87b7056.css">
  565.  </head>
  566.  <body >
  567.    <div data-server-rendered="true" id="__nuxt"><!----><div id="__layout"><div data-app="true" id="app" class="v-application v-application--is-ltr theme--light" style="font-family:Roboto;"><div class="v-application--wrap"><div tabindex="0" aria-label="Loading" class="vld-overlay is-active is-full-page" style="z-index:999;display:none;"><div class="vld-background" style="background:#fff;opacity:0.5;"></div><div class="vld-icon"><svg viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" width="65" height="65" stroke="#1976d2"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".25" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.8s" repeatCount="indefinite"></animateTransform></path></g></g></svg></div></div> <!----> <div class="header-section"><header class="v-sheet theme--light elevation-3 v-toolbar v-app-bar v-app-bar--fixed" style="height:56px;margin-top:0px;transform:translateY(0px);left:0px;right:0px;"><div class="v-toolbar__content" style="height:56px;"><div class="row main-menu"><div role="dialog" class="v-dialog__container"><!----></div> <div role="dialog" class="v-dialog__container"><!----></div> <div class="d-none d-lg-flex d-xl-flex d-md-flex justify-space-between pb-5 col col-12"><div class="d-flex align-center col-md-2 col-lg-1 offset-lg-1 col-4"><a href="/" class="d-flex w-100 nuxt-link-active"><div class="logo d-flex w-100"><div aria-label="Software Developer Questions and Answers" role="img" class="v-image v-responsive theme--light" style="max-height:50px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div></a></div> <!----> <div class="col-md-5 col-lg-5 offset-lg-1 col-4"><button type="button" class="v-btn v-btn--flat v-btn--icon v-btn--round theme--dark v-size--default primary--text"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate mdi mdi-magnify theme--dark"></i></span></button> <a href="/login" class="v-btn v-btn--contained v-btn--router theme--light v-size--default success"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate v-icon--left mdi mdi-message-question-outline theme--light"></i> <span class="d-none d-lg-flex d-xl-flex">Ask Question</span></span></a> <a href="/login" class="v-btn v-btn--depressed v-btn--flat v-btn--outlined v-btn--router theme--light v-size--default success--text"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate v-icon--left mdi mdi-login theme--light"></i><span class="d-none d-lg-flex d-xl-flex">Sign In</span></span></a> <a href="/register" class="v-btn v-btn--depressed v-btn--flat v-btn--outlined v-btn--router theme--light v-size--default info--text"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate v-icon--left mdi mdi-account-plus-outline theme--light"></i><span class="d-none d-lg-flex d-xl-flex">Sign Up</span></span></a></div></div> <nav class="hidden-md-and-up v-navigation-drawer v-navigation-drawer--close v-navigation-drawer--fixed v-navigation-drawer--is-mobile v-navigation-drawer--temporary theme--light" style="height:100vh;top:0px;transform:translateX(-100%);width:256px;"><div class="v-navigation-drawer__content"><div class="v-list v-sheet theme--light"><a href="/" tabindex="0" router="" class="v-list-item v-list-item--link theme--light"><div class="v-list-item__content"><div class="v-list-item__title">Home</div></div></a> <!----> <!----> <!----> <!---->  <a href="/login" tabindex="0" router="" class="v-list-item v-list-item--link theme--light"><div class="v-list-item__content"><div class="v-list-item__title">Sign In</div></div></a> <a href="/register" tabindex="0" router="" class="v-list-item v-list-item--link theme--light"><div class="v-list-item__content"><div class="v-list-item__title">Sign Up</div></div></a> <!----></div></div><div class="v-navigation-drawer__border"></div></nav> <header class="hidden-md-and-up v-sheet theme--light v-toolbar v-app-bar v-app-bar--fixed" style="height:56px;margin-top:0px;transform:translateY(0px);left:0px;right:0px;"><div class="v-toolbar__content" style="height:56px;"><div class="row align-center"><button type="button" class="v-app-bar__nav-icon v-btn v-btn--flat v-btn--icon v-btn--round theme--light v-size--default"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate mdi mdi-menu theme--light"></i></span></button> <div class="d-flex col-10 pr-0 align-center justify-end"><button type="button" class="v-btn v-btn--flat v-btn--icon v-btn--round theme--dark v-size--default primary--text"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate mdi mdi-magnify theme--dark"></i></span></button> <a href="/login" class="v-btn v-btn--flat v-btn--icon v-btn--round v-btn--router theme--light v-size--default success--text"><span class="v-btn__content"><i aria-hidden="true" class="v-icon notranslate mdi mdi-message-question-outline theme--light"></i></span></a> <div class="col-sm-3 col-md-3 col-4"><a href="/" class="nuxt-link-active"><div class="logo d-flex w-100"><div aria-label="Software Developer Questions and Answers" role="img" class="v-image v-responsive theme--light" style="max-height:50px;"><div class="v-responsive__sizer" style="padding-bottom:100%;"></div><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div></a></div></div></div></div></header></div></div></header></div> <div class="container"><!----> <div class="flex"><ul itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList" class="v-breadcrumbs v-breadcrumbs--large theme--light"><li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a href="/" itemprop="item" class="v-breadcrumbs__item nuxt-link-active"><span itemprop="name">Home</span></a> <meta content="1" itemprop="position"></li><li class="v-breadcrumbs__divider">&gt;</li><li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a href="/forum/javascript" itemprop="item" class="v-breadcrumbs__item"><span itemprop="name">JavaScript</span></a> <meta content="2" itemprop="position"></li><li class="v-breadcrumbs__divider">&gt;</li><li itemprop="itemListElement" itemscope="itemscope" itemtype="http://schema.org/ListItem"><a href="#" itemprop="item" class="v-breadcrumbs__item v-breadcrumbs__item--disabled"><span itemprop="name">how to mock exception in jest?</span></a> <meta content="3" itemprop="position"></li></ul></div> <div class="row mx-0 mt-1"><div class="flex md4 lg3 xl2"><div><div class="row d-md-none justify-space-around"><div class="py-0 col-sm-10 col-md-8 col-12"><div class="px-1 transparent v-sheet theme--light"><div class="v-item-group theme--light v-slide-group v-chip-group"><div class="v-slide-group__prev v-slide-group__prev--disabled"><!----></div><div class="v-slide-group__wrapper"><div class="v-slide-group__content"><a href="/forum/php" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default primary--text"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  568.            PHP
  569.          </span></a><a href="/forum/javascript" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  570.            JavaScript
  571.          </span></a><a href="/forum/sql" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  572.            SQL
  573.          </span></a><a href="/forum/golang" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  574.            Golang
  575.          </span></a><a href="/forum/html-css" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  576.            HTML/CSS
  577.          </span></a><a href="/forum/ruby" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  578.            Ruby
  579.          </span></a><a href="/forum/python" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  580.            Python
  581.          </span></a><a href="/forum/java" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  582.            Java
  583.          </span></a><a href="/forum/c-c" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  584.            C/C++
  585.          </span></a><a href="/forum/swift" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  586.            Swift
  587.          </span></a><a href="/forum/other" tabindex="0" draggable="false" router="" class="v-chip v-chip--clickable v-chip--link v-chip--no-color theme--light v-size--default"><span class="v-chip__content"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div>
  588.            Other
  589.          </span></a></div></div><div class="v-slide-group__next v-slide-group__next--disabled"><!----></div></div></div></div></div> <div class="row d-none d-lg-flex d-xl-flex d-md-flex pr-3"><div class="w-100 v-card v-sheet theme--light"><header class="v-sheet theme--dark v-toolbar info" style="height:56px;"><div class="v-toolbar__content" style="height:56px;"><div class="v-toolbar__title">Category</div></div></header> <div style="max-height:800px;overflow-y:auto;"><div><a href="/forum/php" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  590.                PHP
  591.              </div></a></div><div><a href="/forum/javascript" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  592.                JavaScript
  593.              </div></a></div><div><a href="/forum/sql" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  594.                SQL
  595.              </div></a></div><div><a href="/forum/golang" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  596.                Golang
  597.              </div></a></div><div><a href="/forum/html-css" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  598.                HTML/CSS
  599.              </div></a></div><div><a href="/forum/ruby" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  600.                Ruby
  601.              </div></a></div><div><a href="/forum/python" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  602.                Python
  603.              </div></a></div><div><a href="/forum/java" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  604.                Java
  605.              </div></a></div><div><a href="/forum/c-c" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  606.                C/C++
  607.              </div></a></div><div><a href="/forum/swift" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  608.                Swift
  609.              </div></a></div><div><a href="/forum/other" tabindex="0" router="" class="word-break v-list-item v-list-item--link theme--light"><div class="v-list-item__icon"><div class="v-image v-responsive mr-1 theme--light" style="height:24px;width:24px;"><div class="v-image__image v-image__image--preload v-image__image--contain" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div> <div class="v-list-item__title">
  610.                Other
  611.              </div></a></div></div></div> <!----></div></div></div> <div class="flex pl-lg-4 pl-md-4 pl-xl-4 md8 lg9 xl10"><div class="flex"><div itemscope="itemscope" itemtype="http://schema.org/DiscussionForumPosting" class="row"><div class="col-sm-12 col-md-8 col-lg-8 col-12"><h1 itemprop="headline">how to mock exception in jest?</h1></div> <div class="text-md-right text-center col-sm-12 col-md-4 col-lg-4 col-12"><!----> <!----> <button type="button" class="v-btn v-btn--contained theme--dark v-size--default primary"><span class="v-btn__content">New message
  612.      </span></button></div></div> <div role="dialog" class="v-dialog__container"><!----></div> <div class="row"><div class="col col-12"><div class="v-card v-sheet theme--light"><div role="list" class="v-list v-sheet theme--light"><div tabindex="-1" role="listitem" class="v-list-item theme--light"><div class="row thread-row" data-v-3262fcae><!----> <!----> <!----> <!----> <!----> <div class="row mx-3" data-v-3262fcae data-v-3262fcae><div class="col-sm-3 col-md-3 col-lg-2 col-xl-1 col-12" data-v-3262fcae data-v-3262fcae><div itemscope="itemscope" itemtype="http://schema.org/Person" class="avatar text-center" data-v-3262fcae><div><div class="v-avatar" style="height:50px;min-width:50px;width:50px;"><div aria-label="cassandra" role="img" class="v-image v-responsive theme--light"><div class="v-image__image v-image__image--preload v-image__image--cover" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div></div> <p class="my-0 caption">Member</p> <div><a href="/profile/cassandra" class="d-inline-flex"><p itemprop="name" class="subtitle-2 mb-0">
  613.        cassandra
  614.      </p></a></div> <!----></div></div> <div class="py-0 col-sm-9 col-md-9 col-lg-10 col-xl-11 col-12" data-v-3262fcae data-v-3262fcae><!----> <div class="py-0 col col-12" data-v-3262fcae data-v-3262fcae><span class="caption" data-v-3262fcae>by
  615.          <a href="/profile/cassandra" class="d-inline-flex caption" data-v-3262fcae>
  616.            cassandra
  617.          </a></span>, <span class="caption" data-v-3262fcae>in category: </span> <span class="caption" data-v-3262fcae><a href="/forum/javascript" class="d-inline-flex caption" data-v-3262fcae>
  618.            JavaScript
  619.          </a></span>,
  620.        <span class="caption" data-v-3262fcae>2 years ago</span></div> <!----> <!----></div> <div class="col col-12" data-v-3262fcae data-v-3262fcae><div class="forum-text ql-viewer" data-v-3262fcae><p>how to mock exception in jest?</p></div> <div class="d-flex justify-start flex-wrap flex-lg-nowrap flex-md-nowrap flex-xl-nowrap flex-sm-nowrap" data-v-3262fcae><div class="text-center text-lg-left text-md-left text-xl-left text-sm-left col-sm-5 col-md-4 col-lg-2 col-xl-2 col-12" data-v-3262fcae data-v-3262fcae><div class="like-dislike-buttons pt-3" data-v-0348114a data-v-3262fcae><span class="v-badge v-badge--overlap theme--light" data-v-0348114a><span draggable="false" class="v-chip v-chip--outlined theme--light v-size--default info info--text" data-v-0348114a><span class="v-chip__content"><div class="d-flex justify-center" style="--primary-color:#FF6B00;" data-v-0348114a><a href="#" class="like-dislike-buttons__btn" data-v-0348114a><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-up theme--light" data-v-0348114a></i> <small title="53 likes" class="like-dislike-buttons__count" data-v-0348114a>53</small></a> <span class="separator" data-v-0348114a>|</span> <a href="#" class="like-dislike-buttons__btn" data-v-0348114a><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-down theme--light" data-v-0348114a></i> <small title="no dislikes" class="like-dislike-buttons__count" data-v-0348114a>0</small></a></div></span></span><span class="v-badge__wrapper"><span aria-atomic="true" aria-label="Badge" aria-live="polite" role="status" class="v-badge__badge error" style="bottom:calc(100% - 12px);left:calc(100% - 12px);right:auto;top:auto;">53</span></span></span></div></div> <div class="col-sm-7 col-md-8 col-lg-10 col-xl-10 col-12" data-v-3262fcae data-v-3262fcae><div class="justify-center icons d-flex col col-12" data-v-11d4c0a4 data-v-11d4c0a4 data-v-3262fcae><a href="https://www.facebook.com/sharer.php?src=sp&amp;u=https%3A%2F%2Fdevhubby.com%2Fthread%2Fhow-to-mock-exception-in-jest&amp;quote=how%20to%20%23mock%20exception%20in%20%23jest%3F&amp;hashtag=%23mywebforum" rel="nofollow noopener" target="_blank" title="Facebook" data-v-11d4c0a4><img src="https://forum-static.fra1.cdn.digitaloceanspaces.com/assets/images/icons/32/fb.png" width="32" height="32" alt="Facebook" data-v-11d4c0a4></a> <!----> <!----> <a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fdevhubby.com%2Fthread%2Fhow-to-mock-exception-in-jest&amp;text=how%20to%20%23mock%20exception%20in%20%23jest%3F&amp;hashtags=mywebforum" rel="nofollow noopener" target="_blank" title="Twitter" data-v-11d4c0a4><img src="https://forum-static.fra1.cdn.digitaloceanspaces.com/assets/images/icons/32/twitter.png" width="32" height="32" alt="Twitter" data-v-11d4c0a4></a> <a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=https%3A%2F%2Fdevhubby.com%2Fthread%2Fhow-to-mock-exception-in-jest" rel="nofollow noopener" target="_blank" title="LinkedIn" data-v-11d4c0a4><img src="https://forum-static.fra1.cdn.digitaloceanspaces.com/assets/images/icons/32/linkedin.png" width="32" height="32" alt="LinkedIn" data-v-11d4c0a4></a> <a href="https://telegram.me/share/url?url=https%3A%2F%2Fdevhubby.com%2Fthread%2Fhow-to-mock-exception-in-jest" rel="nofollow noopener" target="_blank" title="Telegram" data-v-11d4c0a4><img src="https://forum-static.fra1.cdn.digitaloceanspaces.com/assets/images/icons/32/telegram.png" width="32" height="32" alt="Telegram" data-v-11d4c0a4></a> <a href="https://api.whatsapp.com/send?text=https%3A%2F%2Fdevhubby.com%2Fthread%2Fhow-to-mock-exception-in-jest" rel="nofollow noopener" target="_blank" title="Whatsapp" data-v-11d4c0a4><img src="https://forum-static.fra1.cdn.digitaloceanspaces.com/assets/images/icons/32/whatsapp.png" width="32" height="32" alt="Whatsapp" data-v-11d4c0a4></a> <!----></div></div></div> <div class="row py-0" data-v-3262fcae data-v-3262fcae><div class="text-center col" data-v-3262fcae data-v-3262fcae><a href="/tag/jest" draggable="false" class="mr-2 mb-1 v-chip v-chip--clickable v-chip--label v-chip--link v-chip--outlined v-chip--pill theme--light v-size--small secondary secondary--text" data-v-3262fcae><span class="v-chip__content"><span class="secondary--text text-decoration-none font-weight-bold" data-v-3262fcae><i aria-hidden="true" class="v-icon notranslate mx-0 v-icon--left mdi mdi-pound theme--light secondary--text" style="font-size:16px;" data-v-3262fcae></i>jest
  621.            </span></span></a><a href="/tag/mock" draggable="false" class="mr-2 mb-1 v-chip v-chip--clickable v-chip--label v-chip--link v-chip--outlined v-chip--pill theme--light v-size--small secondary secondary--text" data-v-3262fcae><span class="v-chip__content"><span class="secondary--text text-decoration-none font-weight-bold" data-v-3262fcae><i aria-hidden="true" class="v-icon notranslate mx-0 v-icon--left mdi mdi-pound theme--light secondary--text" style="font-size:16px;" data-v-3262fcae></i>mock
  622.            </span></span></a></div></div></div></div> <!----> <!----></div></div> <hr role="separator" aria-orientation="horizontal" class="v-divider theme--light"> <h4 class="my-4 pl-4 text-capitalize">
  623.            2 answers
  624.          </h4> <hr role="separator" aria-orientation="horizontal" class="v-divider theme--light"> <div tabindex="-1" role="listitem" class="v-list-item theme--light"><div class="v-list-item__icon best-answer"><span class="v-tooltip v-tooltip--bottom"><!----><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-up theme--light success--text" style="font-size:40px;"></i></span></div> <div class="row post-row" data-v-145a8bfc data-v-145a8bfc><!----> <!----> <!----> <!----> <!----> <div class="col-sm-3 col-md-2 col-lg-1 col-12" data-v-145a8bfc data-v-145a8bfc><div itemscope="itemscope" itemtype="http://schema.org/Person" class="avatar text-center" data-v-145a8bfc><div><div class="v-avatar" style="height:50px;min-width:50px;width:50px;"><div aria-label="carey" role="img" class="v-image v-responsive theme--light"><div class="v-image__image v-image__image--preload v-image__image--cover" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div></div> <p class="my-0 caption">Member</p> <div><a href="/profile/carey" class="d-inline-flex"><p itemprop="name" class="subtitle-2 mb-0">
  625.        carey
  626.      </p></a></div> <!----></div></div> <div class="col-sm-9 col-md-10 col-lg-11 col-12" data-v-145a8bfc data-v-145a8bfc><div class="pt-0 col col-12" data-v-145a8bfc data-v-145a8bfc><span class="caption" data-v-145a8bfc>by
  627.        <a href="/profile/carey" class="d-inline-flex caption" data-v-145a8bfc>
  628.          carey </a></span>,
  629.      <span class="caption" data-v-145a8bfc>2 years ago</span></div> <div class="forum-text ql-viewer" data-v-145a8bfc><p><span class="mention"><span><span><span class="mention"><span><span><span class="ql-mention-denotation-char">@</span>cassandra</span></span></span> </span> </span></span></p><p>In Jest, you can use the <code>jest.fn()</code> method to create a mock function, and then use the <code>.mockImplementation()</code> method to make the function throw an exception when it is called. Here is an example:</p><div style="color:#f8f8f2;background-color:#272822;">
  630. <table style="border-spacing:0;padding:0;margin:0;border:0;"><tbody><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
  631. <pre tabindex="0" style="color:#f8f8f2;background-color:#272822;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
  632. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
  633. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
  634. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
  635. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
  636. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
  637. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
  638. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
  639. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
  640. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
  641. </span></pre></td>
  642. <td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
  643. <pre tabindex="0" style="color:#f8f8f2;background-color:#272822;"><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">myMock</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">jest</span>.<span style="color:#a6e22e">fn</span>();
  644. <span style="color:#a6e22e">myMock</span>.<span style="color:#a6e22e">mockImplementation</span>(() =&gt; {
  645.  <span style="color:#66d9ef">throw</span> <span style="color:#66d9ef">new</span> Error(<span style="color:#e6db74">&#39;My error message&#39;</span>);
  646. });
  647.  
  648. <span style="color:#66d9ef">try</span> {
  649.  <span style="color:#a6e22e">myMock</span>();
  650. } <span style="color:#66d9ef">catch</span> (<span style="color:#a6e22e">e</span>) {
  651.  <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#a6e22e">e</span>.<span style="color:#a6e22e">message</span>); <span style="color:#75715e">// &#34;My error message&#34;
  652. </span><span style="color:#75715e"></span>}
  653. </pre></td></tr></tbody></table>
  654. </div>
  655. <p><br/></p><p>You can also use <code>jest.fn().mockImplementationOnce()</code> to only throw the exception on the first call, and then have the mock function return normally on subsequent calls.</p></div></div> <!----> <div class="text-center text-lg-left text-md-left text-xl-left text-sm-left col-sm-5 col-md-4 col-lg-2 col-xl-2 col-12" data-v-145a8bfc data-v-145a8bfc><div class="like-dislike-buttons pt-3" data-v-0348114a data-v-145a8bfc><span class="v-badge v-badge--overlap theme--light" data-v-0348114a><span draggable="false" class="v-chip v-chip--outlined theme--light v-size--default info info--text" data-v-0348114a><span class="v-chip__content"><div class="d-flex justify-center" style="--primary-color:#FF6B00;" data-v-0348114a><a href="#" class="like-dislike-buttons__btn" data-v-0348114a><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-up theme--light" data-v-0348114a></i> <small title="2 likes" class="like-dislike-buttons__count" data-v-0348114a>2</small></a> <span class="separator" data-v-0348114a>|</span> <a href="#" class="like-dislike-buttons__btn" data-v-0348114a><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-down theme--light" data-v-0348114a></i> <small title="no dislikes" class="like-dislike-buttons__count" data-v-0348114a>0</small></a></div></span></span><span class="v-badge__wrapper"><span aria-atomic="true" aria-label="Badge" aria-live="polite" role="status" class="v-badge__badge error" style="bottom:calc(100% - 12px);left:calc(100% - 12px);right:auto;top:auto;">2</span></span></span></div></div> <!----> <div class="col col-12" data-v-145a8bfc data-v-145a8bfc><hr role="separator" aria-orientation="horizontal" class="v-divider theme--light" data-v-145a8bfc></div></div></div><div tabindex="-1" role="listitem" class="v-list-item theme--light"><!----> <div class="row post-row" data-v-145a8bfc data-v-145a8bfc><div class="py-0 col col-12" data-v-145a8bfc data-v-145a8bfc><div data-v-145a8bfc><!----></div></div> <!----> <!----> <!----> <!----> <div class="col-sm-3 col-md-2 col-lg-1 col-12" data-v-145a8bfc data-v-145a8bfc><div itemscope="itemscope" itemtype="http://schema.org/Person" class="avatar text-center" data-v-145a8bfc><div><div class="v-avatar" style="height:50px;min-width:50px;width:50px;"><div aria-label="trenton_kirlin" role="img" class="v-image v-responsive theme--light"><div class="v-image__image v-image__image--preload v-image__image--cover" style="background-image:;background-position:center center;"></div><div class="v-responsive__content"></div></div></div></div> <p class="my-0 caption">Member</p> <div><a href="/profile/trenton_kirlin" class="d-inline-flex"><p itemprop="name" class="subtitle-2 mb-0">
  656.        trenton_kirlin
  657.      </p></a></div> <!----></div></div> <div class="col-sm-9 col-md-10 col-lg-11 col-12" data-v-145a8bfc data-v-145a8bfc><div class="pt-0 col col-12" data-v-145a8bfc data-v-145a8bfc><span class="caption" data-v-145a8bfc>by
  658.        <a href="/profile/trenton_kirlin" class="d-inline-flex caption" data-v-145a8bfc>
  659.          trenton_kirlin </a></span>,
  660.      <span class="caption" data-v-145a8bfc>a year ago</span></div> <div class="forum-text ql-viewer" data-v-145a8bfc><p><span class="mention"><span><span><span class="mention"><span><span><span class="ql-mention-denotation-char">@</span>cassandra</span></span></span> </span> </span></span></p><p>Here&#39;s an example of using jest.fn().mockImplementation() and jest.fn().mockImplementationOnce() to mock an exception in Jest:</p><div style="color:#f8f8f2;background-color:#272822;">
  661. <table style="border-spacing:0;padding:0;margin:0;border:0;"><tbody><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
  662. <pre tabindex="0" style="color:#f8f8f2;background-color:#272822;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
  663. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
  664. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
  665. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
  666. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
  667. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
  668. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
  669. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
  670. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
  671. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
  672. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
  673. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
  674. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
  675. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
  676. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
  677. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
  678. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
  679. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
  680. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
  681. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
  682. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
  683. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
  684. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
  685. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
  686. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
  687. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
  688. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
  689. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
  690. </span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
  691. </span></pre></td>
  692. <td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
  693. <pre tabindex="0" style="color:#f8f8f2;background-color:#272822;">// Mock function to throw an exception
  694. const myMock = jest.fn().mockImplementation(() =&gt; {
  695.  throw new Error(&#39;My error message&#39;);
  696. });
  697.  
  698. // Call the mock function and catch the exception
  699. try {
  700.  myMock();
  701. } catch (e) {
  702.  console.log(e.message); // &#34;My error message&#34;
  703. }
  704.  
  705. // Mock function to throw an exception only on the first call
  706. const myMockOnce = jest
  707.  .fn()
  708.  .mockImplementationOnce(() =&gt; {
  709.    throw new Error(&#39;My error message&#39;);
  710.  })
  711.  .mockReturnValue(&#39;Normal return value on subsequent calls&#39;);
  712.  
  713. // Call the mock function multiple times
  714. try {
  715.  myMockOnce(); // Throws an exception
  716. } catch (e) {
  717.  console.log(e.message); // &#34;My error message&#34;
  718. }
  719.  
  720. console.log(myMockOnce()); // &#34;Normal return value on subsequent calls&#34;
  721. console.log(myMockOnce()); // &#34;Normal return value on subsequent calls&#34;
  722. </pre></td></tr></tbody></table>
  723. </div>
  724. <p><br/></p><p>In this example, the <code>myMock</code> mock function is created using jest.fn().mockImplementation() with a function that throws an error. When the mock function is called, it will throw the specified error.</p><p><br/></p><p>The <code>myMockOnce</code> mock function is created using jest.fn().mockImplementationOnce(). The first time the mock function is called, it will throw an error. On subsequent calls, it will return the normal value specified by mockReturnValue().</p></div></div> <!----> <div class="text-center text-lg-left text-md-left text-xl-left text-sm-left col-sm-5 col-md-4 col-lg-2 col-xl-2 col-12" data-v-145a8bfc data-v-145a8bfc><div class="like-dislike-buttons pt-3" data-v-0348114a data-v-145a8bfc><span class="v-badge v-badge--overlap theme--light" data-v-0348114a><span draggable="false" class="v-chip v-chip--outlined theme--light v-size--default info info--text" data-v-0348114a><span class="v-chip__content"><div class="d-flex justify-center" style="--primary-color:#FF6B00;" data-v-0348114a><a href="#" class="like-dislike-buttons__btn" data-v-0348114a><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-up theme--light" data-v-0348114a></i> <small title="no likes" class="like-dislike-buttons__count" data-v-0348114a>0</small></a> <span class="separator" data-v-0348114a>|</span> <a href="#" class="like-dislike-buttons__btn" data-v-0348114a><i aria-hidden="true" class="v-icon notranslate mdi mdi-thumb-down theme--light" data-v-0348114a></i> <small title="no dislikes" class="like-dislike-buttons__count" data-v-0348114a>0</small></a></div></span></span><span class="v-badge__wrapper"><span aria-atomic="true" aria-label="Badge" aria-live="polite" role="status" class="v-badge__badge error" style="bottom:calc(100% - 12px);left:calc(100% - 12px);right:auto;top:auto;">0</span></span></span></div></div> <!----> <div class="col col-12" data-v-145a8bfc data-v-145a8bfc><!----></div></div></div> <!----></div></div></div></div> <div class="d-flex justify-space-between flex-wrap flex-lg-nowrap flex-md-nowrap flex-xl-nowrap flex-sm-nowrap"><nav role="navigation" aria-label="Pagination Navigation" class="w-100"><ul class="v-pagination theme--light"><li><button type="button" aria-label="Previous page" class="v-pagination__navigation v-pagination__navigation--disabled"><i aria-hidden="true" class="v-icon notranslate mdi mdi-chevron-left theme--light"></i></button></li><li><button type="button" aria-current="true" aria-label="Current Page, Page 1" class="v-pagination__item v-pagination__item--active primary">1</button></li><li><button type="button" aria-label="Next page" class="v-pagination__navigation v-pagination__navigation--disabled"><i aria-hidden="true" class="v-icon notranslate mdi mdi-chevron-right theme--light"></i></button></li></ul></nav> <div class="mx-auto col-sm-2 col-md-3 col-lg-2 col-xl-1 col-6"><div class="v-input v-input--is-label-active v-input--is-dirty theme--light v-text-field v-select"><div class="v-input__control"><div role="button" aria-haspopup="listbox" aria-expanded="false" aria-owns="list-11108250" class="v-input__slot"><div class="v-select__slot"><label for="input-11108250" class="v-label v-label--active theme--light" style="left:0px;right:auto;position:absolute;">Rows per page</label><div class="v-select__selections"><div class="v-select__selection v-select__selection--comma">15</div><input id="input-11108250" readonly="readonly" type="text" aria-readonly="false" autocomplete="off"></div><div class="v-input__append-inner"><div class="v-input__icon v-input__icon--append"><i aria-hidden="true" class="v-icon notranslate mdi mdi-menu-down theme--light"></i></div></div><input type="hidden" value="15"></div><div class="v-menu"><!----></div></div><div class="v-text-field__details"><div class="v-messages theme--light"><div class="v-messages__wrapper"></div></div></div></div></div></div></div> <div class="row mt-2"><div class="col col-12"><h2 class="display-1">Related Threads:</h2></div> <div class="col col-12"><div class="mx-auto v-card v-sheet theme--light"><div role="list" class="v-list v-sheet theme--light v-list--two-line"><!----> <a href="/thread/how-to-mock-useeffect-in-jest" tabindex="0" role="listitem" class="v-list-item v-list-item--link theme--light"><div class="v-avatar v-list-item__avatar v-list-item__avatar--horizontal rounded-0 v-avatar--tile" style="height:90px;min-width:90px;width:90px;"></div> <div class="v-list-item__content"><div class="v-list-item__title">How to mock useeffect in jest?</div></div></a><hr role="separator" aria-orientation="horizontal" class="v-divider theme--light"> <a href="/thread/how-to-mock-eventemitter-in-jest" tabindex="0" role="listitem" class="v-list-item v-list-item--link theme--light"><div class="v-avatar v-list-item__avatar v-list-item__avatar--horizontal rounded-0 v-avatar--tile" style="height:90px;min-width:90px;width:90px;"></div> <div class="v-list-item__content"><div class="v-list-item__title">how to mock eventemitter in jest?</div></div></a><hr role="separator" aria-orientation="horizontal" class="v-divider theme--light"> <a href="/thread/how-to-mock-foreach-in-jest" tabindex="0" role="listitem" class="v-list-item v-list-item--link theme--light"><div class="v-avatar v-list-item__avatar v-list-item__avatar--horizontal rounded-0 v-avatar--tile" style="height:90px;min-width:90px;width:90px;"></div> <div class="v-list-item__content"><div class="v-list-item__title">how to mock foreach in jest?</div></div></a><hr role="separator" aria-orientation="horizontal" class="v-divider theme--light"> <a href="/thread/how-to-mock-a-component-in-jest" tabindex="0" role="listitem" class="v-list-item v-list-item--link theme--light"><div class="v-avatar v-list-item__avatar v-list-item__avatar--horizontal rounded-0 v-avatar--tile" style="height:90px;min-width:90px;width:90px;"></div> <div class="v-list-item__content"><div class="v-list-item__title">How to mock a component in jest?</div></div></a><hr role="separator" aria-orientation="horizontal" class="v-divider theme--light"> <a href="/thread/how-to-mock-lodash-in-jest" tabindex="0" role="listitem" class="v-list-item v-list-item--link theme--light"><div class="v-avatar v-list-item__avatar v-list-item__avatar--horizontal rounded-0 v-avatar--tile" style="height:90px;min-width:90px;width:90px;"></div> <div class="v-list-item__content"><div class="v-list-item__title">how to mock lodash in jest?</div></div></a></div></div></div></div></div></div></div></div> <div pages="" class="footer" data-v-600bef70><!----> <footer class="v-footer footer mt-4 v-sheet theme--light" data-v-600bef70><div class="flex xs12 sm12 md6 lg4" data-v-600bef70><h4 class="title text-center" data-v-600bef70>
  725.        Follow us
  726.      </h4> <div class="social-section" data-v-600bef70><ul class="text-center pr-6" data-v-600bef70><li data-v-600bef70><a href="https://www.facebook.com/groups/devhubby" rel="nofollow" target="_blank" class="transparent--text btn-floating btn-tw waves-effect waves-light" data-v-600bef70><i aria-hidden="true" class="v-icon notranslate blue--text text--darken-4 mdi mdi-facebook theme--light" style="font-size:36px;" data-v-600bef70></i></a></li> <li data-v-600bef70><a href="https://twitter.com/devhubbycom" rel="nofollow" target="_blank" class="transparent--text btn-floating btn-tw waves-effect waves-light" data-v-600bef70><i aria-hidden="true" class="v-icon notranslate blue--text text--lighten-2 mdi mdi-twitter theme--light" style="font-size:36px;" data-v-600bef70></i></a></li> <!----> <li data-v-600bef70><a href="https://devhubby.tumblr.com/" rel="nofollow" target="_blank" class="transparent--text btn-floating btn-youtube waves-effect waves-light" data-v-600bef70><i aria-hidden="true" class="v-icon notranslate red--text text--accent-4 mdi mdi-youtube theme--light" style="font-size:36px;" data-v-600bef70></i></a></li> <li data-v-600bef70><a href="https://www.linkedin.com/groups/14086432/" rel="nofollow" target="_blank" class="transparent--text btn-floating btn-linkedin waves-effect waves-light" data-v-600bef70><i aria-hidden="true" class="v-icon notranslate blue--text text--darken-3 mdi mdi-linkedin theme--light" style="font-size:36px;" data-v-600bef70></i></a></li> <li data-v-600bef70><a href="https://www.instagram.com/dev_hubby/" rel="nofollow" target="_blank" class="transparent--text btn-floating btn-instagram waves-effect waves-light" data-v-600bef70><i aria-hidden="true" class="v-icon notranslate red--text text--darken-3 mdi mdi-instagram theme--light" style="font-size:36px;" data-v-600bef70></i></a></li></ul></div></div> <!----> <div class="flex xs12 sm12 md6 lg4" data-v-600bef70><div class="about-section white-text mx-auto" data-v-600bef70><h4 class="title text-center" data-v-600bef70>About us</h4> <ul class="text-center pr-6" data-v-600bef70><li data-v-600bef70><a href="/contact" rel="nofollow" data-v-600bef70>Contact us</a></li></ul></div></div> <div class="flex xs12 text-center mt-2" data-v-600bef70><span data-v-600bef70>© 2024 Copyright: devhubby.com
  727.      </span> <p class="mb-0" data-v-600bef70>
  728.        This Site is Created By
  729.        <a href="https://mywebforum.com" target="_blank" data-v-600bef70>mywebforum.com</a></p> <p data-v-600bef70>
  730.        Get Your Own
  731.        <a href="https://mywebforum.com" target="_blank" data-v-600bef70>Questions &amp; Answers platform</a></p></div></footer> <!----> <!----></div> <!----> <div class="js-scripts"></div></div></div></div></div><script>window.__NUXT__=(function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aI,aJ,aK,aL,aM,aN,aO,aP,aQ,aR,aS,aT,aU,aV,aW,aX,aY,aZ,a_,a$,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw){aw.id=34527;aw.name=v;aw.messages=8063;aw.threads=4111;aw.meta_title=v;aw.meta_description=v;aw.children=e;aw.icon="category\u002F1af0d4eb-63c1-4c93-893e-d9d6f8f880e3\u002Fphp.png";aw.is_public=c;aw.last_post={id:252356,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Eemma\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003ETo send a PUT request in Laravel, you can use the built-in HTTP client that Laravel provides. Here is an example code snippet that demonstrates how you can make a PUT request using the Laravel HTTP client:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-y19ed3r\"\u003Euse IlluminateSupportFacadesHttp;\n\n$response = Http::put(&#39;http:\u002F\u002Fexample.com\u002Fapi\u002Fresource&#39;, [\n    &#39;key&#39; =&gt; &#39;value&#39;\n]);\n\nif ($response-&gt;successful()) {\n    \u002F\u002F Request was successful\n    $responseData = $response-&gt;json();\n    \u002F\u002F Do something with the response data\n} else {\n    \u002F\u002F Request failed\n    $errorCode = $response-&gt;status();\n    \u002F\u002F Handle the error\n}\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn this code snippet:\u003C\u002Fp\u003E\u003Col\u003E\u003Cli\u003E\u003Cstrong\u003EWe use the Http\u003C\u002Fstrong\u003E::put() method to send a PUT request to the specified URL (http:\u002F\u002Fexample.com\u002Fapi\u002Fresource) with the data payload [&#39;key&#39; =&gt; &#39;value&#39;].\u003C\u002Fli\u003E\u003Cli\u003EWe then check if the request was successful by calling the successful() method on the response object.\u003C\u002Fli\u003E\u003Cli\u003EIf the request was successful, we can retrieve the response data using the json() method. You can then perform any further processing on the response data as needed.\u003C\u002Fli\u003E\u003Cli\u003EIf the request failed, we can retrieve the error code using the status() method and handle the error accordingly.\u003C\u002Fli\u003E\u003C\u002Fol\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EThat&#39;s how you can send a PUT request in Laravel using the Laravel HTTP client.\u003C\u002Fp\u003E",is_moderated:b,username:"mason",user_active:a,created:"2024-10-14T02:06:42Z"};aw.order=a;aw.description=v;aw.slug="php";ax.id=Y;ax.name=j;ax.messages=7853;ax.threads=3992;ax.meta_title=j;ax.meta_description=j;ax.children=e;ax.icon="category\u002F8bc6a538-1878-494b-a68f-d75c0788e762\u002Fjavascript-logo.png";ax.is_public=c;ax.last_post={id:252503,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ejimmie.mante\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E",is_moderated:b,username:"nikki_nikolaus",user_active:a,created:"2024-10-15T16:07:00Z"};ax.order=a;ax.description=j;ax.slug=am;ay.id=34529;ay.name=w;ay.messages=3440;ay.threads=2090;ay.meta_title=w;ay.meta_description=w;ay.children=e;ay.icon="category\u002Fc450d489-f776-42ad-a307-a876104daf91\u002Fsql.png";ay.is_public=c;ay.last_post={id:254900,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ewyman\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003ETo join a table with a result column in Oracle, you can use a subquery to generate the result column and then join it with the desired table. Here is an example:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-1pnmc9b\" language=\"sql\"\u003ESELECT t1.column1, t1.column2, t2.result_column\nFROM table1 t1\nJOIN (SELECT column3 * 2 AS result_column FROM table2) t2\nON t1.column1 = t2.result_column;\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E",is_moderated:b,username:az,user_active:a,created:"2024-11-02T15:23:39Z"};ay.order=a;ay.description=w;ay.slug="sql";aA.id=34530;aA.name=x;aA.messages=1596;aA.threads=980;aA.meta_title=x;aA.meta_description=x;aA.children=e;aA.icon="category\u002F6a57ef72-267d-44d0-b16f-0f5992a25150\u002Fgo2.png";aA.is_public=c;aA.last_post={id:256275,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ekyla.kuvalis\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003ETo parse YAML with a dynamic key in Golang, you can use the \u003Ccode\u003Egopkg.in\u002Fyaml.v2\u003C\u002Fcode\u003E package which provides functions to marshal and unmarshal YAML data.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EHere&#39;s an example code snippet to demonstrate how to parse YAML with a dynamic key in Golang:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-b7t6k39\"\u003Epackage main\n\nimport (\n\t&#34;fmt&#34;\n\t&#34;gopkg.in\u002Fyaml.v2&#34;\n\t&#34;io\u002Fioutil&#34;\n)\n\nfunc main() {\n\t\u002F\u002F Define a struct to unmarshal the YAML data into\n\tvar data map[interface{}]interface{}\n\n\t\u002F\u002F Read the YAML file\n\tyamlFile, err := ioutil.ReadFile(&#34;data.yaml&#34;)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t\u002F\u002F Unmarshal the YAML data into the struct\n\terr = yaml.Unmarshal(yamlFile, &amp;data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t\u002F\u002F Access the dynamic key and its value\n\tdynamicKey := &#34;key1&#34; \u002F\u002F Assuming the dynamic key is &#34;key1&#34;\n\tvalue := data[dynamicKey]\n\tfmt.Println(&#34;Value of dynamic key:&#34;, value)\n}\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn this code snippet:\u003C\u002Fp\u003E\u003Col\u003E\u003Cli\u003EWe define a map with interface{} keys and values to unmarshal the YAML data into, which allows for dynamic keys.\u003C\u002Fli\u003E\u003Cli\u003EWe read the YAML file using ioutil.ReadFile.\u003C\u002Fli\u003E\u003Cli\u003EWe unmarshal the YAML data into the map using yaml.Unmarshal.\u003C\u002Fli\u003E\u003Cli\u003EWe access the value of the dynamic key &#34;key1&#34; (you should replace this with your actual dynamic key).\u003C\u002Fli\u003E\u003C\u002Fol\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EMake sure to replace \u003Ccode\u003E&#34;data.yaml&#34;\u003C\u002Fcode\u003E with the path to your YAML file.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EHope this helps! Let me know if you have any further questions.\u003C\u002Fp\u003E",is_moderated:b,username:"scotty",user_active:a,created:"2024-11-20T10:27:33Z"};aA.order=a;aA.description=x;aA.slug="golang";aB.id=34531;aB.name=y;aB.messages=1452;aB.threads=849;aB.meta_title=y;aB.meta_description=y;aB.children=e;aB.icon="category\u002Ff079ddf7-48d4-4aa3-b2b8-9bf568c958be\u002Fhtmlcss.png";aB.is_public=c;aB.last_post={id:236566,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Eeda.wolff\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003ETo use custom fonts with Tailwind CSS and Nuxt.js, you can follow these steps:\u003C\u002Fp\u003E\u003Col\u003E\u003Cli\u003EAdd your custom font files to your Nuxt.js project. You can do this by placing the font files in the assets\u002Ffonts directory of your Nuxt.js project.\n\u003C\u002Fli\u003E\u003Cli\u003ECreate a CSS file to import and configure your custom fonts. You can create a new CSS file (e.g., custom-fonts.css) in the assets\u002Fcss directory and add the following content:\n\u003C\u002Fli\u003E\u003C\u002Fol\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-we6a9fd\"\u003E@font-face {\n  font-family: &#39;CustomFont&#39;;\n  src: url(&#39;path\u002Fto\u002Fyour\u002Ffont-file.ttf&#39;) format(&#39;truetype&#39;);\n}\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EReplace \u003Ccode\u003E&#39;CustomFont&#39;\u003C\u002Fcode\u003E with the desired font family name and \u003Ccode\u003E&#39;path\u002Fto\u002Fyour\u002Ffont-file.ttf&#39;\u003C\u002Fcode\u003E with the path to your custom font file.\u003C\u002Fp\u003E\u003Col\u003E\u003Cli\u003EImport the custom font CSS file in your nuxt.config.js file. Add the following code to your nuxt.config.js file to import the custom font CSS file:\u003C\u002Fli\u003E\u003C\u002Fol\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-bg4x26z\"\u003Ecss: [\n  &#39;@\u002Fassets\u002Fcss\u002Fcustom-fonts.css&#39;\n],\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Col\u003E\u003Cli\u003EUse the custom font in your Tailwind CSS styles. You can now use the custom font in your Tailwind CSS styles by specifying the font family in your HTML or Vue components. For example:\u003C\u002Fli\u003E\u003C\u002Fol\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-h7v9kzm\"\u003E&lt;h1 class=&#34;font-CustomFont&#34;&gt;Custom Font Title&lt;\u002Fh1&gt;\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EReplace \u003Ccode\u003E&#39;CustomFont&#39;\u003C\u002Fcode\u003E with the font family name specified in your custom font CSS file.\u003C\u002Fp\u003E\u003Col\u003E\u003Cli\u003EBuild and run your Nuxt.js project. Once you have completed the above steps, build and run your Nuxt.js project to see your custom font in action.\u003C\u002Fli\u003E\u003C\u002Fol\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EThat&#39;s it! You have successfully used custom fonts with Tailwind CSS and Nuxt.js.\u003C\u002Fp\u003E",is_moderated:b,username:"santina.kub",user_active:a,created:"2024-06-22T15:27:39Z"};aB.order=a;aB.description=y;aB.slug="html-css";aC.id=34532;aC.name=z;aC.messages=337;aC.threads=223;aC.meta_title=z;aC.meta_description=z;aC.children=e;aC.icon="category\u002F375757a5-d49a-485d-94fc-d28d725ae104\u002Fruby2.png";aC.is_public=c;aC.last_post={id:212726,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Egideon.hauck\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn addition to the code above, you can also use the \u003Ccode\u003Ecreate\u003C\u002Fcode\u003E method with a block to insert data into a database in a more concise way:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-97jubfb\"\u003EArticle.create do |article|\n  article.title = &#34;My Article Title&#34;\n  article.content = &#34;My Article Content&#34;\nend\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EThis is especially useful when you want to perform additional actions or validations before saving the record.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EYou can also use the \u003Ccode\u003Eimport\u003C\u002Fcode\u003E method to efficiently insert multiple records into the database at once. This method bypasses the lifecycle callbacks and validations, making it much faster than individual \u003Ccode\u003Ecreate\u003C\u002Fcode\u003E or \u003Ccode\u003Esave\u003C\u002Fcode\u003E operations. Here&#39;s an example:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-9rl85ye\"\u003Earticles = [\n  { title: &#34;Article 1&#34;, content: &#34;Content 1&#34; },\n  { title: &#34;Article 2&#34;, content: &#34;Content 2&#34; },\n  { title: &#34;Article 3&#34;, content: &#34;Content 3&#34; }\n]\n\nArticle.import(articles)\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EThis will insert the specified records into the database without triggering validations or callbacks. However, keep in mind that the data directly goes into the database, so make sure it&#39;s properly sanitized and validated before using this method.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003ERemember to configure your database connection in config\u002Fdatabase.yml file before inserting data into the database.\u003C\u002Fp\u003E",is_moderated:b,username:az,user_active:a,created:"2024-02-12T11:22:34Z"};aC.order=a;aC.description=z;aC.slug="ruby";aD.id=34533;aD.name=A;aD.messages=4357;aD.threads=3399;aD.meta_title=A;aD.meta_description=A;aD.children=e;aD.icon="category\u002F1c348406-1653-4887-b583-7489de2310f3\u002Fpython.png";aD.is_public=c;aD.last_post={id:257285,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ealex.cummings\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EYou can create a lower diagonal matrix in SymPy using the \u003Ccode\u003EMatrix\u003C\u002Fcode\u003E class and list comprehension. Here&#39;s an example code snippet demonstrating how to create a lower diagonal matrix:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-ccj2pi7\"\u003Efrom sympy import Matrix\n\n# Define the elements of the lower diagonal matrix\nelements = [1, 2, 3, 4]\n\n# Create a lower diagonal matrix with the specified elements\nlower_diagonal_matrix = Matrix([[0 if i &gt;= j else elements[j-i-1] for j in range(len(elements))] for i in range(len(elements)])\n\nprint(lower_diagonal_matrix)\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn this code snippet, we define the elements of the lower diagonal matrix in the \u003Ccode\u003Eelements\u003C\u002Fcode\u003E list. We then use list comprehension to create a matrix with the specified elements where the elements below the diagonal are equal to the corresponding elements in the \u003Ccode\u003Eelements\u003C\u002Fcode\u003E list.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EYou can adjust the \u003Ccode\u003Eelements\u003C\u002Fcode\u003E list to create different lower diagonal matrices with different values.\u003C\u002Fp\u003E",is_moderated:b,username:"alfonzo",user_active:a,created:"2024-12-04T01:58:44Z"};aD.order=a;aD.description=A;aD.slug="python";aE.id=34534;aE.name=B;aE.messages=1952;aE.threads=1272;aE.meta_title=B;aE.meta_description=B;aE.children=e;aE.icon="category\u002F3f08ec78-9350-4d01-9395-77978dfce7e1\u002Fjava.png";aE.is_public=c;aE.last_post={id:253235,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Emadalyn\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EThe hibernate config file, typically named \u003Ccode\u003Ehibernate.cfg.xml\u003C\u002Fcode\u003E, should be placed in the root of your application&#39;s classpath. This means it can be placed in the \u003Ccode\u003Esrc\u002Fmain\u002Fresources\u003C\u002Fcode\u003E directory for Maven projects, or in the \u003Ccode\u003Esrc\u003C\u002Fcode\u003E directory for Eclipse projects. The Hibernate configuration file should be accessible to the application so that it can parse the configuration settings during startup.\u003C\u002Fp\u003E",is_moderated:b,username:"dewayne_green",user_active:a,created:"2024-10-21T22:12:47Z"};aE.order=a;aE.description=B;aE.slug="java";aF.id=34535;aF.name=C;aF.messages=1188;aF.threads=963;aF.meta_title=C;aF.meta_description=C;aF.children=e;aF.icon="category\u002F427d0e6e-1883-44dd-aa69-96672f1362e5\u002Fc.png";aF.is_public=c;aF.last_post={id:255647,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Edora\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E",is_moderated:b,username:"cameron.mccullough",user_active:a,created:"2024-11-11T14:14:53Z"};aF.order=a;aF.description=C;aF.slug="c-c";aG.id=34536;aG.name=D;aG.messages=663;aG.threads=531;aG.meta_title=D;aG.meta_description=D;aG.children=e;aG.icon="category\u002Fe1951c3a-5f15-4bff-b2a1-43f9148ea154\u002Fswift.png";aG.is_public=c;aG.last_post={id:237328,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ekarelle_heathcote\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003EThe @observable macro in Swift is used to define a property that will automatically trigger a change notification when its value is changed. This can be helpful when testing properties that are expected to change during the execution of your code.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003ETo use the @observable macro in unit tests in Swift, you can define a property in your test class with the @Published attribute. Here&#39;s an example:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-i0tsabz\" language=\"swift\"\u003Eimport XCTest\nimport Combine\n\nclass MyTestClass: XCTestCase {\n\n    @Published var myProperty: Int = 0\n\n    func testPropertyChange() {\n        let cancellable = myProperty.sink { value in\n            \u002F\u002F Test the value of the property here\n        }\n\n        myProperty = 10\n\n        \u002F\u002F Make sure to store the cancellable object somewhere to prevent it from being deallocated\n    }\n}\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E",is_moderated:b,username:"napoleon",user_active:a,created:"2024-06-24T18:02:39Z"};aG.order=a;aG.description=D;aG.slug="swift";aH.id=36177;aH.name=ac;aH.messages=19139;aH.threads=13445;aH.meta_title=aI;aH.meta_description=aI;aH.children=e;aH.icon="category\u002F25bf8071-d225-4b00-add3-5ce12dedc414\u002Fic-2dev.png";aH.is_public=c;aH.last_post={id:257309,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Elily.simonis\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003ETo store PowerShell output to a variable, you can use the assignment operator &#34;=&#34; followed by the command whose output you want to store. Here&#39;s an example:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-z9hgr85\"\u003E$variable = Get-Date\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn this example, the output of the Get-Date cmdlet is stored in the variable $variable. You can then use this variable to access the output later in your script.\u003C\u002Fp\u003E",is_moderated:b,username:"roel_stanton",user_active:a,created:"2024-12-04T08:45:47Z"};aH.order=a;aH.description=ac;aH.slug="other";return {layout:al,data:[{sanitizedMessage:i,thread:{id:90749,name:i,message:"\u003Cp\u003Ehow to mock exception in jest?\u003C\u002Fp\u003E",formatted_message:d,image:"thread\u002F2023\u002Ff0246946-66aa-4613-83e9-fdfc09ce8e6f.png",hash_tags:"[\"jest\",\"mock\"]",tags:["jest","mock","mywebforum"],category:{id:Y,name:j,messages:a,threads:a,meta_title:d,meta_description:d,children:e,icon:d,is_public:c,order:a,description:j,slug:am},category_id:Y,slug:Z,best_answer_id:an,likes:53,dislikes:a,is_closed:c,is_pinned:c,is_moderated:b,username:"cassandra",user_active:f,role:g,user_avatar:"avatar\u002Fcassandra\u002F313098749.jpg",created:"2022-12-27T04:01:54Z"},relatedThreads:[{id:86112,title:ao,text:ao,avatar:"avatar\u002Frollin\u002F230028675.jpg",role:g,slug:"how-to-mock-useeffect-in-jest",username:"rollin",created:"2022-11-14T22:59:00Z"},{id:90756,title:ap,text:ap,avatar:"avatar\u002Fsamara\u002Favatar_4619.jpg",role:g,slug:"how-to-mock-eventemitter-in-jest",username:"samara",created:"2022-12-27T04:12:12Z"},{id:90678,title:aq,text:aq,avatar:"avatar\u002Ftina\u002Favatar_0966.jpg",role:g,slug:"how-to-mock-foreach-in-jest",username:"tina",created:"2022-12-26T14:00:37Z"},{id:85680,title:ar,text:ar,avatar:"avatar\u002Fcasey\u002Fanimal0148.gif",role:g,slug:"how-to-mock-a-component-in-jest",username:"casey",created:"2022-11-11T04:28:58Z"},{id:90768,title:as,text:as,avatar:"avatar\u002Fewald\u002F3068.jpg",role:g,slug:"how-to-mock-lodash-in-jest",username:"ewald",created:"2022-12-27T04:31:20Z"}],socialSettings:{id:1876,size:a,facebook:b,vk:c,ok:c,linkedin:b,telegram:b,whatsapp:b,pocket:c,twitter:b,active:b},page:f,totals:f,postsTotal:_,posts:[{id:an,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ecassandra\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn Jest, you can use the \u003Ccode\u003Ejest.fn()\u003C\u002Fcode\u003E method to create a mock function, and then use the \u003Ccode\u003E.mockImplementation()\u003C\u002Fcode\u003E method to make the function throw an exception when it is called. Here is an example:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-ociy977\" language=\"javascript\"\u003Econst myMock = jest.fn();\nmyMock.mockImplementation(() =&gt; {\n  throw new Error(&#39;My error message&#39;);\n});\n\ntry {\n  myMock();\n} catch (e) {\n  console.log(e.message); \u002F\u002F &#34;My error message&#34;\n}\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EYou can also use \u003Ccode\u003Ejest.fn().mockImplementationOnce()\u003C\u002Fcode\u003E to only throw the exception on the first call, and then have the mock function return normally on subsequent calls.\u003C\u002Fp\u003E",formatted_message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ecassandra\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn Jest, you can use the \u003Ccode\u003Ejest.fn()\u003C\u002Fcode\u003E method to create a mock function, and then use the \u003Ccode\u003E.mockImplementation()\u003C\u002Fcode\u003E method to make the function throw an exception when it is called. Here is an example:\u003C\u002Fp\u003E\u003Cdiv style=\"color:#f8f8f2;background-color:#272822;\"\u003E\n\u003Ctable style=\"border-spacing:0;padding:0;margin:0;border:0;\"\u003E\u003Ctbody\u003E\u003Ctr\u003E\u003Ctd style=\"vertical-align:top;padding:0;margin:0;border:0;\"\u003E\n\u003Cpre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;\"\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 1\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 2\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 3\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 4\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 5\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 6\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 7\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 8\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 9\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E10\n\u003C\u002Fspan\u003E\u003C\u002Fpre\u003E\u003C\u002Ftd\u003E\n\u003Ctd style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\"\u003E\n\u003Cpre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;\"\u003E\u003Cspan style=\"color:#66d9ef\"\u003Econst\u003C\u002Fspan\u003E \u003Cspan style=\"color:#a6e22e\"\u003EmyMock\u003C\u002Fspan\u003E \u003Cspan style=\"color:#f92672\"\u003E=\u003C\u002Fspan\u003E \u003Cspan style=\"color:#a6e22e\"\u003Ejest\u003C\u002Fspan\u003E.\u003Cspan style=\"color:#a6e22e\"\u003Efn\u003C\u002Fspan\u003E();\n\u003Cspan style=\"color:#a6e22e\"\u003EmyMock\u003C\u002Fspan\u003E.\u003Cspan style=\"color:#a6e22e\"\u003EmockImplementation\u003C\u002Fspan\u003E(() =&gt; {\n  \u003Cspan style=\"color:#66d9ef\"\u003Ethrow\u003C\u002Fspan\u003E \u003Cspan style=\"color:#66d9ef\"\u003Enew\u003C\u002Fspan\u003E Error(\u003Cspan style=\"color:#e6db74\"\u003E&#39;My error message&#39;\u003C\u002Fspan\u003E);\n});\n\n\u003Cspan style=\"color:#66d9ef\"\u003Etry\u003C\u002Fspan\u003E {\n  \u003Cspan style=\"color:#a6e22e\"\u003EmyMock\u003C\u002Fspan\u003E();\n} \u003Cspan style=\"color:#66d9ef\"\u003Ecatch\u003C\u002Fspan\u003E (\u003Cspan style=\"color:#a6e22e\"\u003Ee\u003C\u002Fspan\u003E) {\n  \u003Cspan style=\"color:#a6e22e\"\u003Econsole\u003C\u002Fspan\u003E.\u003Cspan style=\"color:#a6e22e\"\u003Elog\u003C\u002Fspan\u003E(\u003Cspan style=\"color:#a6e22e\"\u003Ee\u003C\u002Fspan\u003E.\u003Cspan style=\"color:#a6e22e\"\u003Emessage\u003C\u002Fspan\u003E); \u003Cspan style=\"color:#75715e\"\u003E\u002F\u002F &#34;My error message&#34;\n\u003C\u002Fspan\u003E\u003Cspan style=\"color:#75715e\"\u003E\u003C\u002Fspan\u003E}\n\u003C\u002Fpre\u003E\u003C\u002Ftd\u003E\u003C\u002Ftr\u003E\u003C\u002Ftbody\u003E\u003C\u002Ftable\u003E\n\u003C\u002Fdiv\u003E\n\u003Cp\u003E\u003Cbr\u002F\u003E\u003C\u002Fp\u003E\u003Cp\u003EYou can also use \u003Ccode\u003Ejest.fn().mockImplementationOnce()\u003C\u002Fcode\u003E to only throw the exception on the first call, and then have the mock function return normally on subsequent calls.\u003C\u002Fp\u003E",is_moderated:b,likes:_,dislikes:a,thread_title:i,thread_slug:Z,username:"carey",user_avatar:"avatar\u002Fcarey\u002F2520.jpg",user_active:f,role:g,role_logo:d,created:"2023-01-17T23:03:04Z"},{id:204256,message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ecassandra\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EHere&#39;s an example of using jest.fn().mockImplementation() and jest.fn().mockImplementationOnce() to mock an exception in Jest:\u003C\u002Fp\u003E\u003Cpre class=\"code-block ql-syntax\" id=\"code-o6jxbgk\"\u003E\u002F\u002F Mock function to throw an exception\nconst myMock = jest.fn().mockImplementation(() =&gt; {\n  throw new Error(&#39;My error message&#39;);\n});\n\n\u002F\u002F Call the mock function and catch the exception\ntry {\n  myMock();\n} catch (e) {\n  console.log(e.message); \u002F\u002F &#34;My error message&#34;\n}\n\n\u002F\u002F Mock function to throw an exception only on the first call\nconst myMockOnce = jest\n  .fn()\n  .mockImplementationOnce(() =&gt; {\n    throw new Error(&#39;My error message&#39;);\n  })\n  .mockReturnValue(&#39;Normal return value on subsequent calls&#39;);\n\n\u002F\u002F Call the mock function multiple times\ntry {\n  myMockOnce(); \u002F\u002F Throws an exception\n} catch (e) {\n  console.log(e.message); \u002F\u002F &#34;My error message&#34;\n}\n\nconsole.log(myMockOnce()); \u002F\u002F &#34;Normal return value on subsequent calls&#34;\nconsole.log(myMockOnce()); \u002F\u002F &#34;Normal return value on subsequent calls&#34;\n\u003C\u002Fpre\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn this example, the \u003Ccode\u003EmyMock\u003C\u002Fcode\u003E mock function is created using jest.fn().mockImplementation() with a function that throws an error. When the mock function is called, it will throw the specified error.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cp\u003EThe \u003Ccode\u003EmyMockOnce\u003C\u002Fcode\u003E mock function is created using jest.fn().mockImplementationOnce(). The first time the mock function is called, it will throw an error. On subsequent calls, it will return the normal value specified by mockReturnValue().\u003C\u002Fp\u003E",formatted_message:"\u003Cp\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"mention\"\u003E\u003Cspan\u003E\u003Cspan\u003E\u003Cspan class=\"ql-mention-denotation-char\"\u003E@\u003C\u002Fspan\u003Ecassandra\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E \u003C\u002Fspan\u003E \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fp\u003E\u003Cp\u003EHere&#39;s an example of using jest.fn().mockImplementation() and jest.fn().mockImplementationOnce() to mock an exception in Jest:\u003C\u002Fp\u003E\u003Cdiv style=\"color:#f8f8f2;background-color:#272822;\"\u003E\n\u003Ctable style=\"border-spacing:0;padding:0;margin:0;border:0;\"\u003E\u003Ctbody\u003E\u003Ctr\u003E\u003Ctd style=\"vertical-align:top;padding:0;margin:0;border:0;\"\u003E\n\u003Cpre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;\"\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 1\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 2\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 3\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 4\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 5\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 6\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 7\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 8\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E 9\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E10\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E11\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E12\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E13\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E14\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E15\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E16\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E17\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E18\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E19\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E20\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E21\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E22\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E23\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E24\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E25\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E26\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E27\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E28\n\u003C\u002Fspan\u003E\u003Cspan style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"\u003E29\n\u003C\u002Fspan\u003E\u003C\u002Fpre\u003E\u003C\u002Ftd\u003E\n\u003Ctd style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\"\u003E\n\u003Cpre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;\"\u003E\u002F\u002F Mock function to throw an exception\nconst myMock = jest.fn().mockImplementation(() =&gt; {\n  throw new Error(&#39;My error message&#39;);\n});\n\n\u002F\u002F Call the mock function and catch the exception\ntry {\n  myMock();\n} catch (e) {\n  console.log(e.message); \u002F\u002F &#34;My error message&#34;\n}\n\n\u002F\u002F Mock function to throw an exception only on the first call\nconst myMockOnce = jest\n  .fn()\n  .mockImplementationOnce(() =&gt; {\n    throw new Error(&#39;My error message&#39;);\n  })\n  .mockReturnValue(&#39;Normal return value on subsequent calls&#39;);\n\n\u002F\u002F Call the mock function multiple times\ntry {\n  myMockOnce(); \u002F\u002F Throws an exception\n} catch (e) {\n  console.log(e.message); \u002F\u002F &#34;My error message&#34;\n}\n\nconsole.log(myMockOnce()); \u002F\u002F &#34;Normal return value on subsequent calls&#34;\nconsole.log(myMockOnce()); \u002F\u002F &#34;Normal return value on subsequent calls&#34;\n\u003C\u002Fpre\u003E\u003C\u002Ftd\u003E\u003C\u002Ftr\u003E\u003C\u002Ftbody\u003E\u003C\u002Ftable\u003E\n\u003C\u002Fdiv\u003E\n\u003Cp\u003E\u003Cbr\u002F\u003E\u003C\u002Fp\u003E\u003Cp\u003EIn this example, the \u003Ccode\u003EmyMock\u003C\u002Fcode\u003E mock function is created using jest.fn().mockImplementation() with a function that throws an error. When the mock function is called, it will throw the specified error.\u003C\u002Fp\u003E\u003Cp\u003E\u003Cbr\u002F\u003E\u003C\u002Fp\u003E\u003Cp\u003EThe \u003Ccode\u003EmyMockOnce\u003C\u002Fcode\u003E mock function is created using jest.fn().mockImplementationOnce(). The first time the mock function is called, it will throw an error. On subsequent calls, it will return the normal value specified by mockReturnValue().\u003C\u002Fp\u003E",is_moderated:b,likes:a,dislikes:a,thread_title:i,thread_slug:Z,username:"trenton_kirlin",user_avatar:"avatar\u002Ftrenton_kirlin\u002F2200.jpg",user_active:f,role:g,role_logo:d,created:"2023-12-23T00:33:28Z"}]}],fetch:{},error:e,state:{loading:a,settings:{id:8542,name:k,domain:"devhubby.com",port:80,plan:f,plan_name:"free",footer_code:"\u003C!-- Global site tag (gtag.js) - Google Analytics --\u003E\n\u003Cscript async src=\"https:\u002F\u002Fwww.googletagmanager.com\u002Fgtag\u002Fjs?id=G-5LBS05BL1D\"\u003E\u003C\u002Fscript\u003E\n\u003Cscript\u003E\n  window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n\n  gtag('config', 'G-5LBS05BL1D');\n\u003C\u002Fscript\u003E\n\n\u003Cscript async src=\"https:\u002F\u002Fpagead2.googlesyndication.com\u002Fpagead\u002Fjs\u002Fadsbygoogle.js?client=ca-pub-4833888168110763\"\n     crossorigin=\"anonymous\"\u003E\u003C\u002Fscript\u003E",robots_txt:"User-agent: *\nDisallow: \u002Fsearch\nDisallow: \u002Fadmin\nDisallow: \u002Fprofile\nDisallow: \u002Flogin\nDisallow: \u002Fregister\n\nSitemap: https:\u002F\u002Fdevhubby.com\u002Fsitemap.xml",locale:"en",add_source:a,allow_likes:f,add_watermark:f,add_watermark_position:3,hash:"c64c6733-bfad-4db8-b387-18207476d4d5",default_role:at,allow_hash_tags:f,add_source_text:d,scrollable_pagination:a,meta_title:k,blog_active:c,favicon_png:"\u002Ffavicon.png",favicon_ico:d,custom_css:".amzn-native-container {\n    margin: 0 auto;\n}\n \n.forum-text.ql-viewer div{\n    border-radius: 5px;\n}",meta_description:k,description:k,logo:"logo\u002Fdev.png",is_related_thread:f,related_thread:au,notify_on_moderation:b,activation:"email",facebook:"https:\u002F\u002Fwww.facebook.com\u002Fgroups\u002Fdevhubby",linkedin:"https:\u002F\u002Fwww.linkedin.com\u002Fgroups\u002F14086432\u002F",twitter:"https:\u002F\u002Ftwitter.com\u002Fdevhubbycom",youtube:"https:\u002F\u002Fdevhubby.tumblr.com\u002F",instagram:"https:\u002F\u002Fwww.instagram.com\u002Fdev_hubby\u002F"},layout:{id:8650,is_dark:a,name:al,background_full:c,code_theme:"monokai",page_transition:"fade",background:d,background_color:d,text_color:d,text_font_family:"Roboto",primary_color:$,secondary_color:u,accent_color:u,info_color:u,success_color:u,error_color:$,warning_color:$},social_providers:{google:b,facebook:b,github:b},menus:[],showAd:c,darkMode:c,isFooterVisible:c,cdnUrl:"https:\u002F\u002Fforum-static.fra1.cdn.digitaloceanspaces.com",metaOg:{title:i,url:"https:\u002F\u002Fdevhubby.com\u002Fthread\u002Fhow-to-mock-exception-in-jest",type:d,image:"https:\u002F\u002Fforum-static.fra1.cdn.digitaloceanspaces.com\u002Fimages\u002Fc64c6733-bfad-4db8-b387-18207476d4d5\u002Fthread\u002F2023\u002Ff0246946-66aa-4613-83e9-fdfc09ce8e6f.png",description:i,site_name:k},itemsPerPage:15,ad:[{id:23,name:"Own domain footer",css_selector:d,position:_,one_time:c,show_every:a,code:"\u003Cdiv class=\"flex\"\u003E\n\u003Ca href=\"https:\u002F\u002Fgosrc.cc\u002Fgo\u002FoJqr0c6SR\" target=\"_blank\"\u003E\u003Cimg src=\"https:\u002F\u002Fblogweb-static.fra1.cdn.digitaloceanspaces.com\u002Fpromo\u002Fbanner.png\" style=\"max-height:200px; max-width:100%;\" \u002F\u003E\u003C\u002Fa\u003E\n\u003Cdiv\u003E",active:b,free:b},{id:541,name:"left under menu",css_selector:d,position:11,one_time:c,show_every:a,code:"\u003Cscript async src=\"https:\u002F\u002Fpagead2.googlesyndication.com\u002Fpagead\u002Fjs\u002Fadsbygoogle.js?client=ca-pub-4833888168110763\"\n     crossorigin=\"anonymous\"\u003E\u003C\u002Fscript\u003E\n\u003C!-- devhubby --\u003E\n\u003Cins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-4833888168110763\"\n     data-ad-slot=\"2818766036\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"\u003E\u003C\u002Fins\u003E\n\u003Cscript\u003E\n     (adsbygoogle = window.adsbygoogle || []).push({});\n\u003C\u002Fscript\u003E",active:b,free:c},{id:542,name:"in list",css_selector:d,position:7,one_time:b,show_every:au,code:av,active:b,free:c},{id:555,name:"post",css_selector:d,position:8,one_time:b,show_every:f,code:av,active:b,free:c}],profileStats:{fetched:c,personalMessages:a},stats:{fetched:c,threads:a,posts:a},breadcrumbs:[{text:aa,disabled:c,href:ab},{text:j,disabled:c,href:"\u002Fforum\u002Fjavascript"},{text:i,disabled:b}],categories:[aw,ax,ay,aA,aB,aC,aD,aE,aF,aG,aH],categoriesWithChildren:[aw,ax,ay,aA,aB,aC,aD,aE,aF,aG,aH],roles:[{code:at,logo:d,name:g},{code:"ROLE_MODERATOR",logo:d,name:aJ},{code:"ROLE_ADMIN",logo:d,name:"Administrator"}],i18n:{routeParams:{}},auth:{user:e,loggedIn:c,strategy:"local"}},serverRendered:b,routePath:"\u002Fthread\u002Fhow-to-mock-exception-in-jest",config:{_app:{basePath:ab,assetsPath:ab,cdnURL:"https:\u002F\u002Fpub-1e27250373774d6ca37239bbf5810b5c.r2.dev\u002Fassets\u002F0.3\u002F"}},__i18n:{langs:{en:{common:{common_badge_blog:"blog",common_badge_post:"forum",common_badge_page:"page",answers:"no answers | 1 answer | {count} answers",likes:"no likes | 1 like | {count} likes",dislikes:"no dislikes | 1 dislike | {count} dislikes",show_more:aK,show_less:"Show Less",go_back:"Go Back",go_home_page:"Go Home Page",max_tag_reached:"Max Count of Tags Reached",in_category:"in category: ",our_privacy:"See our Privacy Policy",count_best_answers:aL,search_ask_question:"Do you want to create a thread?",check_internet_connection:"You are offline! Check your internet connection.",by:"by",cookie_text:"This site uses cookies to ensure you get the best experience. By clicking \"Got it\" or continuing to browse the website, you are agreeing to our use of cookies.",got_it:"Got it",signature:aM,author_marked_as_best:aN,no_transition:"No Transition",mail_services:"Mail Services",free_files:"The current plan has a limit 10 files",user_not_active:"Deleted user",confirm_email_text:"We just sent an email to you with the confirmation code. Please put the confirmation code in field below.",main_top_ad:"Ad in all pages on the top",main_bottom_ad:"Ad in all pages on the bottom",blog_in_category_ad:"Ad in blog category",blog_post_top_ad:"Ad in blog post on the top",blog_post_bottom_ad:"Ad in blog post on the bottom",blog_in_post_ad:"Ad in blog post",forum_in_thread_ad:"Ad in forum thread",forum_in_post_ad:"Ad in forum post",sliding_ad:"Sliding Ad on all pages",page_ad:"Ad on the page",sidebar_under_menu:"Left sidebar under menu",site_is_not_ready:"You site is not ready yet",thanks_choosing_us:"Thank you for giving us the opportunity to serve you",register_site_first:"You need register your site first at",create_forum:"create a forum",create_forum_free:"free forum",create_forum_free_text:aO,create_qa_free_text:aO,create_qa_free:"Questions & Answers platform",support_text:"support forum",post_subject:aP,how_to_create_text:"If you have any question about our platform - you can easily ask us. We are always ready to help you by contact form or by our",subcategory:"Subcategories",category:aQ,main_page:"Main Page",banned:"Banned User",no_banned:"Not Banned User",new_message:"New",not_read:"Not Read",spam:"Spam",trusted:aR,no_trusted:"Common User",security_questions:"Registration Questions",nice_to_see_you:"Nice to see you again",records_not_found:"No records found",not_found:"There were no results for your search.",member_from:"Member from",last_seen:"Last seen",not_authorized:"Sign in to your account",account:"Account",last_message:" Last Reply ",from:" from ",thanks_confirming:"Thank you for using our service. Account successfully confirmed!",thanks_confirming_details:"You can use your credentials to login into system",mail_settings_valid:"Congratulations! Mail Settings verified successfully and ready to use",terms:"Terms & Conditions",privacy:aS,accept_terms:"I Agree to the Terms and Conditions",need_accept_terms:"You must agree to the Terms and Conditions in order to register",copyright_text:"This Site is Created By",security_messages:"Secure messages",na:"N\u002FA",active:aT,no_active:"Inactive",attention:"Attention!",count_topics:aU,need_moderation:"Approve message",no_data:"No data",no_files:"No files",no_records:"No records",no_messages:"No messages",count_messages:E,menu:l,search:F,action:"Action",pin_topic:"Pin topic",unpin_topic:"Unpin topic",existing_client:"Existing user? Sign In",close_topic:"Close topic",open_topic:"Open topic",rows_per_page:"Rows per page",top_menu:"Top menu",bottom_menu:"Bottom menu",waiting_approval:"Waiting approval",second:"Second",minute:"Minute",hour:"Hour",message:E,messages:E,topic_closed:"Topic closed",important_topic:"Important topic",threads:aV},animation:{default_fade:"Default Fade",fade_up:"Fade Up",fade_right:"Fade Right",fade_down:"Fade Down",fade_left:"Fade Left",rotate:"Rotate",rotate_down_left:"Rotate Down Left",rotate_down_right:"Rotate Down Right",rotate_up_left:"Rotate Up Left",rotate_up_right:"Rotate Up Right",slide_down:"Slide Down",slide_left:"Slide Left",slide_right:"Slide Right",slide_up:"Slide Up",flip:"Flip",flip_x:"Flip X",flip_y:"Flip Y",zoom:"Zoom",zoom_down:"Zoom Down",zoom_left:"Zoom Left",zoom_right:"Zoom Right",zoom_up:"Zoom Up",light_speed:"Light Speed",bounce:"Bounce",bounce_down:"Bounce Down",bounce_left:"Bounce Left",bounce_right:"Bounce Right",bounce_up:"Bounce Up"},tabs:{delete_forum:m,translation_settings:aW,inbox_pm:"Inbox",sent_pm:"Sent",moderator_main:"Statistic",moderator_threads:aX,role_settings:G,hash_tags_settings:n,moderator_users:H,export_settings:o,moderator_posts:I,blog_settings:J,privacy_settings:K,badge_settings:L,ad_settings:M,file_settings:p,my_profile_stat:"My Statistics",main_settings:"General Settings",mail_settings:N,layout_settings:O,forum_settings:"Categories",member_settings:aY,social_providers:P,page_settings:Q,menu_settings:"Menu Settings",social_settings:R,security_settings:S,profile:aZ,messages:E,redirect_settings:ad,topics:aU},modals:{delete_forum:"I understand that the forum and all data will be permanently removed.",delete_tag:"Are you sure you want to delete this hash tag?",delete_tag_confirm:"Please confirm that you want to delete this hash tag",delete_badge:"Are you sure you want to delete this badge?",delete_badge_confirm:"Please confirm that you want to delete this badge",new_pm:"Compose Message",delete_role:"Are you sure you want to delete this role?",delete_role_confirm:"Please confirm that you want to delete this role",delete_user:"Are you sure you want to delete this user?",delete_file:"Are you sure you want to delete this file?",delete_file_confirm:"Please confirm that you want to delete this file",delete_user_confirm:"Please confirm that you want to delete this user",delete_thread:"Are you sure you want to delete this thread?",delete_thread_confirm:"Please confirm that you want to delete this thread",delete_ad:"Are you sure you want to delete this Ad?",delete_ad_confirm:"Please confirm that you want to delete this Ad",delete_blog_content:"Are you sure you want to delete this post?",delete_blog_content_confirm:"Please confirm that you want to delete this post",delete_blog_category:a_,delete_blog_category_confirm:"Please confirm that you want to delete this category and related subcategories, posts.",delete_redirect:"Are you sure you want to delete this redirect?",delete_redirect_confirm:"Please confirm that you want to delete this redirect link.",delete_category:a_,delete_category_confirm:"Please confirm that you want to delete this category and related subcategories, threads, posts.",delete_menu:"Are you sure you want to delete this menu link?",delete_menu_confirm:"Please confirm that you want to delete this menu link.",delete_page:"Are you sure you want to delete this page?",delete_page_confirm:"Please confirm that you want to delete this page.",delete_message:"Are you sure you want to delete this message?",delete_message_confirm:"Please confirm that you want to delete this message.",delete_topic:"Are you sure you want to delete this topic?",delete_topic_confirm:"Please confirm that you want to delete this topic and related posts.",delete_all_topic_message:"Are you sure you want to delete all messages?",delete_all_topic_message_confirm:"Please confirm that you want to delete all messages",delete_all_topic_text:"Are you sure you want to delete all topics?",delete_all_topic_text_confirm:"Please confirm that you want to delete all topics"},errors:{page_not_found:"Page not found",other_error:"Error happened"},toasts:{voted:"Your vote is counted",email_sent:"Confirmation Code Sent to Email",logout:"You successfully logged out",category_created:"Category successfully created!",category_updated:"Category successfully updated!",ad_created:"Ad successfully created!",ad_updated:"Ad successfully updated!",menu_created:"Menu link successfully created!",menu_updated:"Menu link successfully updated!",page_created:"Page successfully created!",page_updated:"Page successfully updated!",register_successfully:"You have successfully registered",confirm_email:"Please confirm your email address",posts_waiting_approval:"Posts waiting approval:",users_waiting_approval:"Users waiting approval:",threads_waiting_approval:"Threads waiting approval:",favicon_updated:"Favicon successfully updated",background_updated:"Background successfully updated",select_logo:"Please select logo",select_favicon:"Please select favicon",logo_updated:"Logo successfully updated",logo_deleted:"Logo successfully deleted",profile_updated:"Profile successfully updated",avatar_updated:"Avatar successfully updated",select_avatar:"Please select image file",select_background:"Please select background image file",auth_success:"Logged in successfully",settings_success:"Settings successfully updated",terms_success:"Terms successfully updated",message_send:"Message has been sent",created:ae,updated:"Updated",password_changed:"Password changed successfully",record_created:ae,deleted:"Deleted",success:"Success",error:"Error happened."},titles:{upgrade_pro:af,admin_delete:m,translation_settings:a$,hash_tag_settings:n,badge_settings:L,roles:G,search:F,social_providers:P,confirm_account:ba,how_to_create:"How To Create Your Own Free Forum",category_settings:bb,edit_member:ag,export_settings:o,file_settings:p,blog_settings:J,ad_settings:M,blog_content:T,blog_category:q,blog:U,my_pm:r,view_pm:ah,members:bc,redirects:ad,menu:l,pages:Q,layout_settings:O,social_settings:R,security_settings:S,terms_settings:K,mail_settings:N,admin_index:V,moderator_index:W,moderator_threads:bd,moderator_users:H,moderator_posts:I,change_password:s,view_profile:"user profile",my_profile:ai,register:be,login:h,restore_password:t,contact_us:X},descriptions:{upgrade_pro:af,admin_delete:m,translation_settings:a$,hash_tag_settings:n,badge_settings:L,roles:G,social_providers:P,confirm_account:ba,how_to_create:"How To Create Your Own Free Forum. If you need a free modern forum - you can create it right now.",category_settings:bb,export_settings:o,edit_member:ag,moderator_index:W,file_settings:p,moderator_threads:bd,moderator_users:H,moderator_posts:I,ad_settings:M,blog_settings:J,my_pm:r,view_pm:ah,blog:U,blog_category:q,blog_content:T,members:bc,redirects:ad,menu:l,terms_settings:K,layout_settings:O,pages:Q,social_settings:R,security_settings:S,admin_index:V,mail_settings:N,change_password:s,view_profile:"user profile. Contacts, messages, topics.",my_profile:ai,register:be,login:h,restore_password:t,contact_us:"You can always send us message and we always ready to help. "},mail:{other:ac,gmail:"Gmail",yandex:"Yandex",yahoo:"Yahoo",mail:"Mail.ru",rambler:"Rambler",bing:"Bing",outlook:"Outlook",aol:"AOL"},activations:{email:"Email confirmation required",manually:"Manually by admin\u002Fmoderator",automatically:"Automatically, after registration"},toc:{disabled:"No Active",top:"Top",bottom:"Bottom"},export:{yes:"Yes",no:"No",blog_category:q,blog:"Blog Posts",forum:"Forum",profile:"Profiles"},watermark:{center:"Center",top_left:"Top-Left Corner",top_right:"Top-Right Corner",bottom_left:"Bottom-Left Corner",bottom_right:"Bottom-Right Corner"},conditions:{threads:aV,posts:"Posts",best_answers:aL},forms:{default_role:"Default role for new users",hash_tag:"Hash Tag",hash_tags:"Tags (not required)",meta_title:"Meta Title",meta_description:"Meta Description",value:"Value",condition:"Condition",allow_hash_tags:"Enable Hash Tags",access_pm:r,create_post:"Create Post",edit_own_post:"Edit Own Post",edit_any_post:"Edit Any Post",moderate_data:"Moderate Posts\u002FThreads etc...",access_to_admin_tool:"Access to Admin Tool",register_limit:"Registration limit",permissions:"Permissions",created:ae,scrollable_pagination:"Scrollable pagination",is_public_category:"Access to everyone",roles:"Only roles have access",add_source:"Add Source Whenever Copy Text?",allow_likes:"Allow to user likes posts and threads?",add_watermark:"Add Watermark to Images?",add_watermark_position:"Watermark Position",messages_before_auto_approved:"How many posts approve manually for the new users?",add_source_text:"Text:",move_to_category:"Move Threads and Messages to Category",blog_move_to_category:"Move Content to Category",default_add_source_text:"Read more at:",category:"Category:",code_theme:"Code Editor Theme:",user_link_type:"Type:",user_link:"Link:",is_profile_public:"Make Profile Public:",add_social_link:"Add Social Link",confirm_your_email:"Confirm your email",background_full:"Full Screen Image",notifications:"Notifications",to_username:"To",page_transition:"Page Transition",subject:"Subject",signature:aM,no_ad:"No Ad in this post",max_length:"Max XX characters",custom_css:"Custom CSS",security_question_question:bf,is_related_post:"Enable Related Posts",related_post:"Count of Related Posts",is_related_thread:"Enable Related Threads",related_thread:"Count of Related Threads",from_name:"From:",to_name:"To:",role:bg,created_date:"Created at",status:"Status",export_data:"export data",export_data_deleted:"Unfortunately export deleted because we store it just in 3 days. If you need fresh data please create a new request.",export_data_deleted_short:"Unfortunately export deleted",export_settings:"Export Settings",security_question_answer:"Answer","messages_before_au to_approved":"How many approved messages for new clients",mark_uncertain_messages:"Moderate manually uncertain messages",thread_limit:"Thread limit",directory_name:"Directory name",nofollow:"Add for links rel=nofollow",blog_social_sizes:"Icon Size",notify_on_moderation:"Notify me about messages\u002Fthreads on moderation",directory:"Directory",summary:"Summary",badge_name:"Badge Name",badge_description:bh,badge_icon:"Icon",banned:"Banned",robots_txt:"Robots.txt",toc:aP,one_time:"Show one time",show_every:"Show every",show_after:"Show after",css_selector:"CSS selector",code:"Code",file:"File",question:bf,answer:"You answer",thread_limit_type:"Thread limit by",register_limit_type:"Register limit",trusted:aR,edit_profile:bi,post_limit:"Post limit",post_limit_type:"Post limit by",category_name:"Category name",category_description:"Category Description",blog_category:aQ,text_font_family:"Font Family",add_in_menu:"Add In Menu",avatar:"Avatar",template:"Template",old_url:"Old URL",new_url:"New URL",image:bj,is_dark:"Dark Mode",logo:"Logo",topic_name:bk,open_new_tab:"Open in new tab",no_index:"Noindex page by google, bing, yahoo etc...",text_link:"Link text",select_page:"Select page",select_manually:"Manually",parent_category:"Parent Category",link:"Link",name:aj,encryption:"Encryption",host:"Host",port:"Port",user:bl,page:"Page",position:"Position",type_background:"Background",no_background:"None",background_color:"Color",background_image:bj,activation:"Activate new members",password:"Password",new_password:"New password",confirm_password:"Confirm password",username:bl,firstname:"First name",favicon:"Favicon",favicon_png:"Favicon PNG",forum_name:aj,active:aT,page_name:aj,forum_description:bh,footer_code:"Footer custom code (ex. google analytics code)",lastname:"Last name",update:bm,email:"Email",company:"Company",message:"Message",text:"Text"},social_size:{small:"Small",medium:"Medium",large:"Large"},buttons:{upgrade_pro:af,delete_forum:m,buy_now:"Get Started",make_default_role:"Set role as the default for new users",edit_hash_tag:"Edit Hash Tag",new_hash_tag:"Add Hash Tag",new_badge:"Add Badge",edit_badge:"Edit Badge",add_role:bn,edit_role_link:"Edit Role",add_role_link:bn,login_google:h,login_facebook:h,login_github:h,cancel:"Cancel",delete_and_keep_messages:"Delete (keep messages\u002Fthreads)",login_google_tooltip:"Login with Google",login_facebook_tooltip:"Login with Facebook",login_github_tooltip:"Login with Github",moderate:aJ,best_answer:aN,answer:bo,my_profile:aZ,ask_question:"Ask Question",add_redirect:"New Redirect",edit_redirect:"Edit Redirect",search_more:"Search More",resend_code:"Resend Code",confirm_email:"Confirm Email",show_more:aK,add_ad:bp,edit_ad:"Edit Ad",new_ad:bp,new_file:"New File",deactivate:"Deactivate",activate:"Activate",unbanned:"Unbanned",bann:bq,new_pm:"Compose",spam:"Mark As Spam",blog_social_share:"Social Share Buttons",new_export:br,export_data:br,new_directory:"New Directory",upload_file:"Upload File",upload_directory:"Create folder",edit_category:bs,edit_thread:"Edit Thread",add_category:bt,add_menu_link:bu,blog_category:q,blog_content:T,edit_menu_link:"Edit link",new_menu:bu,validate_mail_settings:"Validate",new_page:"New Page",read:"Read More",new_blog_category:bt,edit_blog_category:bs,new_blog_content:"New Post",edit_blog_content:"Edit Post",edit_page:"Edit Page",upload_avatar:"Upload avatar",upload_logo:"Upload Logo",delete_logo:"Remove Logo",upload_favicon:"Upload Favicon",upload_favicon_png:"Upload Favicon PNG",topic_name:bk,contact_us:X,home:aa,upload_background:"Upload background image",ban:bq,unban:"Unban",delete_all_topic:"Delete all topics",delete_all_messages:"Delete all messages",admin:"Admin Dashboard",profile:bv,signin:"Sign In",register:ak,change_password:s,role:bg,logout:"Logout",reply:"Reply to this topic",reply_pm:bo,edit_post:"Edit post",new_post:"Add message",save:"Save",edit:"Edit",new_message:"New message",restore_password:t,remove:"Remove",login:h,close:"Close",add:"Add",update:bm,delete:"Delete",reset:"Reset Color Schema",send:"Send",clear:"Clear"},headers:{admin_hash_tags:n,admin_badges:L,roles:G,search:F,related_post:"Related Posts",related_thread:"Related Threads",edit_profile:bi,admin_members:"Users",export_settings:o,select_export:"Please select export settings",posts_on_moderation:"Posts on moderation",threads_on_moderation:"Threads on moderation",users_on_moderation:"Users on moderation",moderator_home:W,my_pm:r,moderator_index:"Statistics",admin_home:V,blog:U,change_password:s,admin_redirects:"List of Redirect",admin_ad:"List of Ads",file_settings:p,view_profile:"User profile",color_settings:"Theme Color Settings",primary_color:"Primary Color",secondary_color:"Secondary Color",accent_color:"Accent Color",info_color:"Info Color",success_color:"Success Color",error_color:"Error Color",warning_color:"Warning Color",my_profile:ai,register:ak,menu:l,follow_us:"Follow us",about_us:"About us",login:h,restore_password:t,contact_us:X},breadcrumbs:{pro:"PRO status",admin_delete:m,translation:aW,privacy:aS,hash_tag_settings:n,badge_settings:"Badge",menu_home:l,social_providers:P,search:F,export_settings:o,confirm_account:"Account confirmation",blog_home:U,pm:r,view_pm:ah,blog_content:T,blog_settings:J,ad_settings:M,file_settings:p,privacy_settings:K,forum_settings:"Category Settings",mail_settings:N,layout_settings:O,redirects:"Redirects",blog_categories:q,edit_member:ag,members:aY,pages:Q,social_settings:R,security_settings:S,admin_index:V,moderator_threads:aX,moderator_posts:I,moderator_users:H,moderator_index:W,change_password:s,home:aa,view_profile:"User Profile",my_profile:bv,login:h,register:ak,contact_us:X,restore_password:t},plan:{success:"Payment Successful!",success_detail:"Your payment was successfully processed. Thank you for your purchase!",failed:"Payment Failed",failed_detail:"We're sorry, but your payment could not be processed.",failed_detail_line_2:"Please check your payment details and try again.",free:"Free",free_price:"$0\u002Fmo",free_description:"Great for starters",pro:"Pro",pro_price:"$9.99\u002Fmo",pro_description:"Most popular",enterprise:bw,enterprise_price:bw,custom_price:"Custom",feature:{unlimited_posts:"Unlimited Posts",unlimited_threads:"Unlimited Threads",unlimited_category:"Unlimited Category",unlimited_users:"Unlimited Users",ssl:"Free SSL",use_own_domain:"Use your own domain",spam_protection:"Spam Protection",ad_free:"AD Free",no_copyright:"No Copyright in the Footer",dedicated_server:"Dedicated Server"}}}}}}}(0,true,false,"",null,1,"Member","Login","how to mock exception in jest?","JavaScript","Software Developer Questions and Answers","Menu","Delete Forum","Hash Tags","Export","File Settings","Blog Category","Personal Messages","Change password","Restore password","#0095FF","PHP","SQL","Golang","HTML\u002FCSS","Ruby","Python","Java","C\u002FC++","Swift","Messages","Search","Roles","Moderate Users","Moderate Posts","Blog Settings","Privacy Settings","Badges","Ad Settings","Mail Settings","Layout Settings","Social Logins","Pages","Social Settings","Security Settings","Blog Content","Blog","Admin dashboard","Moderator dashboard","Contact us",34528,"how-to-mock-exception-in-jest",2,"#FF6B00","Home","\u002F","Other","Redirect","Created","Upgrade to PRO","Edit User Details","View Message","My Profile","Name","Sign Up","qa","javascript",128791,"How to mock useeffect in jest?","how to mock eventemitter in jest?","how to mock foreach in jest?","How to mock a component in jest?","how to mock lodash in jest?","ROLE_CLIENT",5,"\u003Cscript async src=\"https:\u002F\u002Fpagead2.googlesyndication.com\u002Fpagead\u002Fjs\u002Fadsbygoogle.js?client=ca-pub-4833888168110763\"\n     crossorigin=\"anonymous\"\u003E\u003C\u002Fscript\u003E\n\u003Cdiv style=\"max-width:750px; margin:0 auto\"\u003E\n\u003Cins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-format=\"fluid\"\n     data-ad-layout-key=\"-ed+6k-30-ac+ty\"\n     data-ad-client=\"ca-pub-4833888168110763\"\n     data-ad-slot=\"3505177655\"\u003E\u003C\u002Fins\u003E\n\u003C\u002Fdiv\u003E\n\u003Cscript\u003E\n     (adsbygoogle = window.adsbygoogle || []).push({});\n\u003C\u002Fscript\u003E",{},{},{},"hortense_donnelly",{},{},{},{},{},{},{},{},"Other Programming Languages","Moderator","Show More","Best Answers","Signature","Best Answer","Get Your Own","Table of Contents","Category","Trusted User","Privacy Policy","Active","Topics","Threads","Translation","Moderate Threads","Members","Profile","Are you sure you want to delete this category?","Translation Settings","Your account was successfully confirmed","Forum Category Settings","List Users","Moderate Thread","Register for the forum","Question","Role","Description","Edit Profile","Image","Title","Username","Update","Add Role","Reply","New Ad","Ban","Export Data","Edit Category","New Category","Add a new menu link","My profile","Enterprise"));</script><script src="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/7b8ec9d.js" defer></script><script src="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/25edc65.js" defer></script><script src="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/863688a.js" defer></script><script src="https://pub-1e27250373774d6ca37239bbf5810b5c.r2.dev/assets/0.3/cb42003.js" defer></script>
  732.  </body>
  733. </html>
  734.  
Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda