【问题标题】:Advanced front end test framework for node.jsnode.js 的高级前端测试框架
【发布时间】:2013-05-29 05:14:27
【问题描述】:

我正在开发一个 node.js + express 应用程序。

我要做的是定义一个强大的测试基础来使用。

所以我真的读到了nice article,它解释了如何使用 ruby​​ on rails 开发一个简单的应用程序。

我阅读了以下几行代码,给了我很多启发:

visit signup_path
fill_in "Name",         with: "Example User"
fill_in "Email",        with: "user@example.com"
fill_in "Password",     with: "foobar"
fill_in "Confirmation", with: "foobar"
click_button "Create my account"

所以我来了。有没有办法使用 node.js 及其依赖项编写类似的代码?

我目前使用的是 mocha 1.x,应该是 1.2.x 和 supertest 0.6.x,但它们似乎不符合我的需求。

【问题讨论】:

    标签: node.js unit-testing


    【解决方案1】:

    您正在寻找类似zombie.js 或selenium (js-webdriver) 的东西,它们从浏览器pov 测试您的代码。我建议先看看zombie.js。

    【讨论】:

    【解决方案2】:
    【解决方案3】:

    Mocha.js 也是一个受欢迎的选择,尤其是如果你喜欢 Coffeescript

    【讨论】:

    • I am currently using mocha 1.x
    猜你喜欢
    • 1970-01-01
    • 2012-12-13
    • 2011-05-11
    • 1970-01-01
    • 2021-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多