0
我正在为通过输入对象循环的函数编写一个chai测试。此代码正常工作。如何用chai.js断言测试多个输入?
they('should return the number of nodes in the graph', function (graph, expected) {
expect(graph.numberOfNodes()).to.equal(expected)
}, {
basic: 6,
withNewline: 6,
doubleDigits: 13,
nonConsecutive: 5
})
但作为一个练习,我想它写在“断言”的风格。
they('should return the number of nodes in the graph', function(graph, xxxx) {
assert.equal((graph.numberOfNodes()), yyyy)
})
如果我将xxxx留空并为yyyy输入一些数字,则所有输入都会根据该数字进行测试。但是,我当然想要根据正确的输入来测试正确的输出,就像“expect”语法所做的那样。