cm0002@suppo.fi to Programmer Humor@programming.dev · 23 hours agoSenior devs...suppo.fiimagemessage-square70fedilinkarrow-up1685arrow-down118
arrow-up1667arrow-down1imageSenior devs...suppo.ficm0002@suppo.fi to Programmer Humor@programming.dev · 23 hours agomessage-square70fedilink
minus-squarejjjalljs@ttrpg.networklinkfedilinkarrow-up1·6 hours agoJavascript has mocking with jest: https://jestjs.io/docs/mock-functions There’s an example there of mocking our axios (a common library for network requests, a la python requests) It’s been a long time since I’ve used java, but mockito exists: https://site.mockito.org/javadoc/current/org/mockito/Mockito.html#2 (Usage note for anyone unfamiliar, but despite the name java and JavaScript are radically different languages.)
Javascript has mocking with jest: https://jestjs.io/docs/mock-functions
There’s an example there of mocking our axios (a common library for network requests, a la python requests)
It’s been a long time since I’ve used java, but mockito exists: https://site.mockito.org/javadoc/current/org/mockito/Mockito.html#2
(Usage note for anyone unfamiliar, but despite the name java and JavaScript are radically different languages.)