我非常喜欢使用BDD和PHP中的Behat。是否有类似于JavaScript的等效工具,即使用Gherkin DSL?到目前为止,我看到的所有工具更像RSpec,如果可能的话,我想更像Cucumber那样接近JS测试。
我非常喜欢使用BDD和PHP中的Behat。是否有类似于JavaScript的等效工具,即使用Gherkin DSL?到目前为止,我看到的所有工具更像RSpec,如果可能的话,我想更像Cucumber那样接近JS测试。
我写作时正在开发一个相关的项目 - 如果您能帮忙,请提供帮助。 http://groups.google.com/group/cukes/browse_thread/thread/56ba76eac2e9dab3
现在进行了编辑,并已经发布了!
Yadda 支持 Given / When / Then 风格的语法。它可以插入到其他测试框架中,如 qunit、mocha 或 casperjs,并允许您按照以下方式编写测试...
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