【发布时间】:2015-08-24 14:17:55
【问题描述】:
我了解到this way 是在 describe() 中循环遍历 it() 的最佳方式,但它因“未找到规范”而失败,并且似乎在 for 循环函数之前停止,我想知道我哪里做错了?
谢谢!
describe('this is my looping test!', function() {
var input = [1,2,3];
var output = [10, 20, 30];
function test_my_times_ten(input, output) {
it('should multiply ' + input + ' by 10 to give ' + output, function() {
expect(input * 10).toEqual(output)
});
}
for(var x = 0; x < input.size; x++) {
test_my_times_ten(input[x], output[x]);
}
});
【问题讨论】:
-
您是否尝试过在循环之外使用它(“..”,cb)?有用吗?
-
@elad.chen 不确定这将如何工作....你能证明你的意思吗?非常感谢! :)
标签: javascript unit-testing jasmine jasmine-node