是的,您可以使用Mocha动态创建带有案例的测试套件。我已经在全球范围内安装了摩卡
npminstall -g mocha,我应该使用。
var should = require('should');var foo = 'bar';['nl', 'fr', 'de'].forEach(function(arrElement) { describe(arrElement + ' suite', function() { it('This thing should behave like this', function(done) { foo.should.be.a.String(); done(); }); it('That thing should behave like that', function(done) { foo.should.have.length(3); done(); }); });});


