Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 将批异步添加到Vows套件_Node.js_Testing_Vows - Fatal编程技术网

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找不到任何测试,因为批处理是异步添加的。但我不知道如何使这项工作。我想用誓言来利用记者