我正在尝试理解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”