What is a good unit testing framework for a JavaScript project using Backbone.js, grunt, and phantom.js?
-
Hey all, I am working on a large enterprise JavaScript project and have to chose a unit testing framework before we go ahead. The unit testing will mostly test backbone.js scripts. I am currently trying to decide between Jasmine/ http://Intern.io/ quint. I wanted quoras input on the subject. Can anyone speak to the pros and cons of each, other suggestions welcome. We are using grunt and phantom.js. Thanks quora!
-
Answer:
For unit testing, the choice for me is usually between Jasmine and Mocha+Chai+Sinon. Most new projects in JS I see going on usually have their unit tests in one of those frameworks. Mocha's selling point is its flexibility (which means you have to pair it with Chai for assertions and Sinon for stubs/mocks). However, Jasmine and Mocha+Chai+Sinon are both really really similar, so it depends on whether you want the pick-and-choose approach or the batteries-mostly-included approach (Jasmine). One thing to note is that with Jasmine, you will want to pair it with jasmine.async because Jasmine's builtin async testing sucks. I've never used http://theintern.io, but it seems really interesting. I'll have to look into it. I've never used QUnit so I can't comment on that.
Brian Chu at Quora Visit the source
Other answers
Vows is another popular choice - http://vowsjs.org/ though I use Jasmine myself...
Brian Takita
Related Q & A:
- What's a good mobile phone plan for a study abroad student?Best solution by internationalstudentinsurance.com
- What is a good way to break in a snowboard?Best solution by answers.yahoo.com
- What is a good quality universal remote for a reasonable price?Best solution by thewirecutter.com
- What is a good score to get on a college placement test?Best solution by Yahoo! Answers
- What is a good thing to put on a job application when they ask whats the reason for leaving the position?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.