【问题标题】:Is there a BDD framework for testing Javascript that uses Gherkin DSL?是否有用于测试使用 Gherkin DSL 的 Javascript 的 BDD 框架?
【发布时间】:2011-07-14 19:21:14
【问题描述】:
我非常喜欢 BDD 和 PHP 的 Behat。是否有与 Javascript 等效的东西,即使用Gherkin DSL?到目前为止,我所看到的一切都更符合 RSpec,如果可能的话,我想像 Cucumber 一样进行 JS 测试
【问题讨论】:
标签:
javascript
unit-testing
cucumber
bdd
javascript-framework
【解决方案3】:
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