Meteor 1.3服务器测试

时间:2016-04-13 08:46:58

标签: meteor mocha

我正在尝试理解http://guide.meteor.com/testing.html测试指南但老实说我不知道​​如何在mocha驱动程序上运行服务器端测试。一切都作为客户端测试运行,我对“服务器测试”进行了0次测试。 如果我将测试文件放在server /(server/users.test.js)下,它将被加载并执行(即console.log('foo')),但describe ..内的函数不会。

编辑:

if(Meteor.isServer) {
  describe('todos', function () {
    describe('mutators', function () {
      console.log(1)
      it('builds correctly from factory', function () {
        console.log(2);
      });
    });
  });
}

imports/api/user/users.test.js内打印“1”而不是“2”

0 个答案:

没有答案