16

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

JoshuaDavid
  • 8,861
  • 8
  • 47
  • 55

4 Answers4

11

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

Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
6

cucumber.js should be exactly what you're looking for. Not quite finished, but might be worth checking out.

slipset
  • 2,960
  • 2
  • 21
  • 17
4

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                     
Steve
  • 3
  • 1
cressie176
  • 959
  • 7
  • 8
2

Kyuri: https://github.com/nodejitsu/kyuri

Bill Burcham
  • 739
  • 5
  • 12