
BDD For Node - Introducing vows-bdd  - craigkerstiens
http://rzrsharp.net/2011/08/16/introducing-vows-bdd.html
======
snprbob86
I looked at vows and Jasmine and a few of the other RSpec-inspired libraries
for Javascript/CoffeeScript. What I determined was that Javascript simply
doesn't have the necessary features to properly replicate RSpec's syntax. For
example, if you want to run tests against Internet Explorer, you can't use any
method_missing or noSuchMethod magic.

I adapted bits and pieces of CoffeeScript's cakefile. It basically defines
`function test(description, runTest)` and uses the builtin node assert module.
Simple and got the job done:

[https://github.com/jashkenas/coffee-
script/blob/master/Cakef...](https://github.com/jashkenas/coffee-
script/blob/master/Cakefile#L151)

------
dorkitude
I'd love to hear how this stacks up against Jasmine (Pivotal's DOM-less JS TDD
project).

Is vows-bdd like a Cucumber to vows'/jasmine's RSpec?

~~~
jmreidy
Jasmine is a great library, especially for anyone coming from the Rspec world.
The syntax is incredibly similar to Resp, and when Jasmine is written in
CoffeeScript, it's one of the most readable testing libraries I've seen (in
any language).

The biggest benefit to Vows is its "everything can be async" nature. This
approach makes testing incredibly fast. It's also built in a very modular way
that allows for what it calls "batching" - which is really just test
metaprogramming. Vows-bdd is just using this capacity for metaprogramming, so
it's not too much more than a "mini-DSL" on top of Vows itself.

Vows-bdd is very much inspired by two libraries from Nodejitsu: prenup (a
general purpose fluent vocabulary on top of vows) and api-easy (which uses
Vows for simple, readable testing of API endpoints). All three of these
libraries aren't really doing anything more than pre-wiring Vows tests
together. I think it's a reflection of Vows' power that it can be so easily
metaprogrammed in this style.

------
mathrawka
It looks pretty nice from the example given. One of my biggest complaints
about node.js is the testing frameworks produce some very hard to read and
maintain code.

I'm currently using vows for my unit tests and expresso for my integrated
testing. I'll give vows-bdd a try in place of expresso when I get a chance.

~~~
jmreidy
Thanks! I've been happy with how simple vows-bdd has made construction of my
integration tests.

One big benefit of expresso are its helpers. While it's not difficult to
supplement Vows with similar functions, Vows still doesn't have a built-in
approach for pre-test bootstrapping.

------
chaosgame
Am I the only one who read through the article looking for where Binary
Decision Diagrams came in?

