【问题标题】: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 测试

【问题讨论】:

  • 接受的答案不再有效,Kyuri repo 已过期。正确答案是 Johnno Nolan 的:github.com/cucumber/cucumber-js
  • @Xolv.io 你是对的。更新。谢谢!

标签: javascript unit-testing cucumber bdd javascript-framework


【解决方案1】:

在我写的时候有一个正在开发中-如果你能帮忙http://groups.google.com/group/cukes/browse_thread/thread/56ba76eac2e9dab3

编辑,现在它在这里!

The official Cucumber for javascript

【讨论】:

    【解决方案2】:

    cucumber.js 应该正是您想要的。尚未完成,但可能值得一试。

    【讨论】:

      【解决方案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                     
      

      【讨论】:

        【解决方案4】:

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-01-11
          相关资源
          最近更新 更多