How to test file upload using Jasmine BDD

I am using the jQuery file upload plugin to control the loading of image files. What would be the right way to test image submission using Jasmine.

+5
source share
1 answer

I would look at using the Sinon.js helper library. You can mock the XMLHttpRequest object to intercept the mail request and make sure your plugin code sends images correctly. In particular, look at this part of the Sinon.js documentation:

http://sinonjs.org/docs/#server

+2
source

All Articles