Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are there any approaches and tools for driving the development of JavaScript with BDD. I know that I can do this through the UI with tools like Selenium, but is there any tool that can allow this to happen at the unit testing level?

I would ideally like to write scenarios for the JavaScript behaviors and use unit tests to prove that the JavaScript works.

share|improve this question
up vote 4 down vote accepted

Jasmine is a BDD tool for JavaScript.

share|improve this answer

In the company I'm currently working on, we tested out some testing frameworks out there, and we finally decided to go with Jasmine. This is what we found:

  • JsUnit: This is one of the oldest unit testing framework, that was later being maintained by Pivotal Labs. But even they are using Jasmine now :P.
  • JSpec: This is an RSpec like BDD unit testing framework. We didn't like some of the ways things are done with it, as well as the magic strings in "expect(cart).to(receive, 'addProduct', 'twice')"
  • Jasmine: This is RSpec like as well and was the one that we found was more complete and easy to use and implement. You definitely have to try it out. The easiness of running it's web server (with just rake jasmine), along it's easy extensiveness (implementing matchers is really easy) made it our preferred option.

To complement this, I would also suggest you take a look at these exquisite libraries:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.