I have an AngularJS application, which needs file uploads, and as $http
does not support the special features of XMLHttpRequest.upload
, I have to perform the file upload using an XMLHttpRequest.
My question is: Can I use the $httpBackend
to unit test the requests made via new XMLHttpRequest()
?
I have some tests made, but at the moment $httpBackend
is throwing errors. Without calling $httpBackend.flush()
it complained about unsatisfied requests, but adding the flush
, just caused an "No pending requests" error.
Extensive use of search engines didn't yield an answer for me, so can you help me?