无法使用mocha开始测试

时间:2015-09-30 06:16:29

标签: node.js sails.js mocha sequelize.js

以下是我在运行mocha测试时遇到的错误......

upquire@0.0.0 test D:\tecsol\mtv
mocha test/bootstrap.test.js test/unit/**/*.test.js

1) "before all" hook
  0 passing (3m)
  1 failing

1)  "before all" hook:
  Error: timeout of 50000ms exceeded. Ensure the done() callback is being called in this test.
  at null.<anonymous> (D:\tecsol\mtv\node_modules\mocha\lib\runnable.js:189:19)

以下是我的bootstrap.test.js文件:

var Sails = require('sails');
var sails;

before(function(done) {
  this.timeout(5000);
  Sails.lift({
    // configuration for testing purposes
  }, function(err, server) {
    sails = server;
    if (err) return done(err);
    // here you can load fixtures, etc.
    done(err, sails);
  });
});

after(function(done) {
  // here you can clear fixtures, etc.
  Sails.lower(done);
});

0 个答案:

没有答案