【发布时间】:2014-12-12 10:04:41
【问题描述】:
我有一个 express.js 应用程序,我在其中使用 supertest 和 should.js 作为我的测试框架。我在测试无序数组中的值时遇到问题。
According to the should.js documentation, the .any function would work here. 任何关于如何让它工作的想法将不胜感激。
预期响应
{data: [
{username:"Test User 3", ...},
{username:"Test User 6", ...}
]}
尝试的验证调用
response.body.data.any.username.should.equal("Test User 3");
response.body.data.any.username.should.equal("Test User 6");
提前感谢您的帮助!
【问题讨论】:
标签: javascript node.js testing express should.js