Node.js 将批异步添加到Vows套件
我有一些这样的代码。我的想法是从文件中读取夹具数据,并使用每个文件中的数据添加批次:Node.js 将批异步添加到Vows套件,node.js,testing,vows,Node.js,Testing,Vows,我有一些这样的代码。我的想法是从文件中读取夹具数据,并使用每个文件中的数据添加批次: // test.js var vows = require('vows') , async = require('async') , suite; exports.suite = suite = vows.describe('My tests'); function run_tests() { set_up = [ find_tests(tests_path) // gets test
// test.js
var vows = require('vows')
, async = require('async')
, suite;
exports.suite = suite = vows.describe('My tests');
function run_tests() {
set_up = [
find_tests(tests_path) // gets test data
];
async.series(set_up, function(errs, tests) {
tests = tests.pop();
tests.forEach(function(test) {
var batch = make_batch(test); // makes a batch
suite.addBatch(batch);
})
});
}
run_tests();
显然,vows test.js找不到任何测试,因为批处理是异步添加的。但我不知道如何使这项工作。我想用誓言来利用记者