Saturday, May 11, 2024
85
rated 0 times [  89] [ 4]  / answers: 1 / hits: 18590  / 13 Years ago, sun, march 20, 2011, 12:00:00

There are 30+ testing frameworks listed on the node.js module list...



Which frameworks are most popular? And what are their pros and cons?



I'm looking for a framework that supports unit testing of code that has a lot of async callbacks (probably like most other node projects). Also, I'm looking for something rather simple and small than complex.



So far I've looked into:




  • Nodeunit is straightforward and supports async code by letting you define how many assertions you expect to be called and when a test is done.

  • Vowsjs looks interesting. Allows you to nicely structure the tests and comes with many advanced features. Not sure whether these features are actually useful, through, or if they rather stand in your way?


More From » unit-testing

 Answers
79

expresso and vows are the most popular options. Although there are many good options out there. Update: As of Nov./2011, Mocha is the successor to expresso, according to the Readme.md at the expresso repository. should.js is often used with Mocha to allow BDD-style assertions.



Whatever you choose, I recommend using gently to stub core or third party modules.



I use/maintain testosterone, a little testing framework that runs test on serial so you can abuse gently. Not so many people using it though.


[#93174] Friday, March 18, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rayvenc

Total Points: 666
Total Questions: 125
Total Answers: 99

Location: Northern Ireland
Member since Mon, Nov 14, 2022
2 Years ago
rayvenc questions
Tue, Apr 21, 20, 00:00, 4 Years ago
Mon, Apr 13, 20, 00:00, 4 Years ago
Sun, Mar 1, 20, 00:00, 4 Years ago
;