Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What unit testing framework should I choose for javascript development, if such

ID: 659242 • Letter: W

Question

What unit testing framework should I choose for javascript development, if such a thing exists.

It should ideally (in rough order of priority):

facilitate the repeated testing of user interface elements such as complicated forms*
be as simple as possible to create new tests
output it's results in a place which is nicely formatted or is easy to format
support the test driven development paradigm
fit in with the good parts, as described by Douglas Crockford
play nicely with popular tools such as angular, ember, meteor and backbone.
work with vanilla javascript without the use of third party frameworks like jQuery (though a strong case can be made to negate this requirement)

This is a a lot of 'nice to haves', consider it as an ideal wishlist, the best solution will hit as many of these as possible.

Where it runs from is not an issue really, assume the developer is at the level where they are well versed in OOP / js etc. and at a level to seriously tackle more advanced concepts like TDD.

*a real world example of where i see huge productivity gains could be acheived is a form with at least thirty fields at work that was tested manually ~1000 or more times - this is what I mean by testing user interface elements

Explanation / Answer

My team used Jasmine. It's one of the first JS testing frameworks that appeared on the scene, and it's still in active development.

Writing tests with it is easy, it just takes some statements. If you are doing TDD, that's probably something you probably care about, since you don't want to spend all your time writing tests, or soon you'll get tired of it.

It uses a little bit of functional style, which might not be what your average OOP coder is used to, but if you are dealing with JavaScript, so there's little escape from it.

It does not have external dependencies, so no jQuery needed.

Have a look at the doc and see if it fits your needs for checking lots of fields

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote