Skip to Content
0
Dec 28, 2022 at 12:04 PM

For unit testing OData model requests, are we suppose to use Sinon.js - Fake XHR or Spy call ?

147 Views

To test functions with OData requests in UI5 apps, is the developer supposed to write unit testing functions with Sinon.js framework's Fake XHR or Spy call?

I am asking as we don't have raw XMLHttpRequest in UI5 apps, we use ODataModel's create, read methods to make a network call. In what cases or scenarios do we need to use Fake XHR or Spy call?

Can we skip network request of UI5 apps for unit testing ?