Reputation: 9519
I am very much a fan of BDD and Behat for PHP. Is there something equivalent for Javascript, ie, that uses the Gherkin DSL? Everything I've seen so far is more in line with RSpec, and I would like to approach JS testing more like Cucumber, if possible
Upvotes: 16
Views: 7726
Reputation: 3078
cucumber.js should be exactly what you're looking for. Not quite finished, but might be worth checking out.
Upvotes: 6
Reputation: 968
Yadda supports a Given / When / Then style syntax. It plugs into other testing frameworks like qunit, mocha or casperjs, and allows you to write tests as follows...
Scenario: A bottle falls from the wall
Given 100 green bottles are standing on the wall
when 1 green bottle accidentally falls
then there are 99 green bottles standing on the wall
Scenario: No bottles are left
Given 1 green bottles are standing on the wall
when 1 green bottle accidentally falls
then there are 0 green bottles standing on the wall
Upvotes: 4
Reputation: 29659
There is one being developed as i write - help out if you can http://groups.google.com/group/cukes/browse_thread/thread/56ba76eac2e9dab3
Edit and now its here!
The official Cucumber for javascript
Upvotes: 11