background preloader

Unit test, bdd, tdd, ... for node.js

Facebook Twitter

Vow BDD for node.js

Visionmedia/should.js - GitHub. Visionmedia/expresso - GitHub. Caolan/nodeunit - GitHub. Insanely fast, headless full-stack testing using Node.js. Assaf/zombie - GitHub. Philc/shoulda.js - GitHub. Testing your JavaScript with shoulda.js. Static Version The last thing you want this weekend is to be introducing bugs at 4:30PM on Sunday as you frantically hack in more functionality.

One way to avoid that risk is to write some tests for your critical, stable bits. If you have time this weekend to hack on unit tests in between the red-bull-induced coma and the confused debates about sockets vs. ports (unlikely!) , shoulda.js will help you get up and running very quickly. Shoulda.js is a micro javascript unit testing framework inspired by Thoughtbot's Shoulda for Ruby. It gives you a tight syntax for writing terse, readable unit tests. It weighs in at under 300 lines and makes no assumptions about your javascript environment or libraries. Get Started Here's how to get started. Mario_tests.js load("mario.js"); context("super mario", setup(function() { game = new SuperMarioGame(); }), Tests.run(); You can run this file using v8: $ v8 mario_test.jsPass (19/19) Stubbing or stub(document, "getElementById", returns(myElement)); Enjoy! Cucumber - Making BDD fun.

Cucumber/cucumber-js - GitHub. Noblesamurai/cucumis - GitHub. Emerleite/node-database-cleaner - GitHub.