是否有用于测试使用 Gherkin DSL 的 Javascript 的 BDD 框架?

发布于 2024-10-21 22:48:16 字数 213 浏览 2 评论 0原文

我非常喜欢 BDD 和 PHP 的 Behat。 Javascript 是否有等效的东西,即使用 Gherkin DSL?到目前为止我所看到的一切都更符合 RSpec,如果可能的话,我希望更像 Cucumber 那样进行 JS 测试

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

烟若柳尘 2024-10-28 22:48:16

在我撰写本文时,正在开发一个 - 如果可以的话请帮忙 http://groups .google.com/group/cukes/browse_thread/thread/56ba76eac2e9dab3

编辑,现在就在这里!

用于 JavaScript 的官方 Cucumber

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

此刻的回忆 2024-10-28 22:48:16

cucumber.js 应该正是您要寻找的。尚未完全完成,但可能值得一看。

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

吃颗糖壮壮胆 2024-10-28 22:48:16

Yadda 支持给定/何时/然后样式语法。它可以插入其他测试框架,如 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                     

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                     
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文