0
我想通过一些选项循环,并根据这些选项在摩卡生成测试。我已经建立了一个简单的动态测试概念证明,基于这个要点:https://gist.github.com/cybertk/fff8992e12a7655157ed在摩卡动态构建测试 - TypeError:test.retries不是函数
当我运行dynamicSuite.addTest()时,我总是收到错误:“TypeError:test.retries不是函数” 。我无法弄清楚是什么导致了错误。似乎没有太多关于摩卡建设测试方法的文档。
下面的代码:
var dynamicSuite = describe('dynamic suite', function() {
this.timeout(10000);
before(function (done) {
var a = ['a', 'b', 'c'];
for(let item of a){
dynamicSuite.addTest(new common.Mocha.Test('test' + item, function(done){
done();
}));
}
done();
});
it('this is needed to make sure tests run', function (done) {
done();
});
after(function(done) {
done();
});
});//end describe test block
谢谢。我猜人们不会使用TDD风格? – mags