Node.JS testing DOM with Mocha?

I’m trying to do some simple view testing in my Node.JS
app using the Mocha testing framework…

For example, I want to test that the


    on the page has n


  1. children, given the number of records I setup in my test.

    I tried using Apricot
    to do this, and while I got it to work, when it fails the error messages are fantastically unhelpful… also, it doesn’t always work.

    What I’d love is a simple way to test the response body for HTML elements, so I can determine if they match the data they should be displaying.

    Here’s my test in it’s current state: https://gist.github.com/2330685

    Anyone know how I can do this?

    Problem courtesy of: neezer

    稿源:Node.js Recipes (源链) | 关于 | 阅读提示

    本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
    酷辣虫 » 前端开发 » Node.JS testing DOM with Mocha?

    喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录