I'm writing a Javascript application using browserify and babel to support ECMAScript 6. I want to write unit tests for it. This application has Web APIs dependencies like DOMParser and XMLHttpRequest.
I've tried the following to write proper unit tests:
-
headless mode using
sinon.JSandmochaCLI. Result: it didn't meet my needs because I would have to write many mocks for Web API; -
mochifywith PhantomJS: slow, and I couldn't get to work with accepting new keywords such asPromise. This is how I ran my test:./node_modules/.bin/mochify --transform babelify
Any ideas on what I should use to write proper unit tests using the technologies I'm using? Maybe a github example of such scenario?
Aucun commentaire:
Enregistrer un commentaire