Meteor Jasmine:服务器单元存根错误
Meteor Jasmine: Server Unit Stubbing Errors
在tests/jasmine/server/unit/z-collection-stubs.js
我有
Meteor.Collection.prototype._ensureIndex = function(){};
在tests/jasmine/server/z-collection2.js
我有
Meteor.Collection.prototype.attachSchema = function () {};
Meteor.users.attachSchema = function () {};
我遇到的错误
W20150326-10:55:08.089(-5)? (STDERR) [sanjo:jasmine]: The file "/home/jimmie/Documents/project/lib/collections/match.js" has syntax errors. [TypeError: Object [object Object] has no method '_ensureIndex']
I20150326-10:55:08.091(-5)? [sanjo:jasmine]: loading source file: /home/jimmie/Documents/project/lib/collections/user.js
W20150326-10:55:08.091(-5)? (STDERR) [sanjo:jasmine]: The file "/home/jimmie/Documents/project/lib/collections/messaging.js" has syntax errors. [TypeError: Object [object Object] has no method '_ensureIndex']
I20150326-10:55:08.093(-5)? [sanjo:jasmine]: loading source file: /home/jimmie/Documents/project/lib/routes/config.js
W20150326-10:55:08.093(-5)? (STDERR) [sanjo:jasmine]: The file "/home/jimmie/Documents/project/lib/collections/user.js" has syntax errors. [TypeError: Object [object Object] has no method 'attachSchema']
所以我的存根似乎没有正确设置,尽管它们似乎在测试之前加载。
好的,我有两个问题。
首先,我应该坚持的原型是
Mongo.Collection
并且文件需要在 test/jasmine/server/unit/
中才能使加载顺序正确。
我不确定同时为客户端和服务器提供正确的加载顺序和存根需要什么。
在tests/jasmine/server/unit/z-collection-stubs.js
我有
Meteor.Collection.prototype._ensureIndex = function(){};
在tests/jasmine/server/z-collection2.js
我有
Meteor.Collection.prototype.attachSchema = function () {};
Meteor.users.attachSchema = function () {};
我遇到的错误
W20150326-10:55:08.089(-5)? (STDERR) [sanjo:jasmine]: The file "/home/jimmie/Documents/project/lib/collections/match.js" has syntax errors. [TypeError: Object [object Object] has no method '_ensureIndex']
I20150326-10:55:08.091(-5)? [sanjo:jasmine]: loading source file: /home/jimmie/Documents/project/lib/collections/user.js
W20150326-10:55:08.091(-5)? (STDERR) [sanjo:jasmine]: The file "/home/jimmie/Documents/project/lib/collections/messaging.js" has syntax errors. [TypeError: Object [object Object] has no method '_ensureIndex']
I20150326-10:55:08.093(-5)? [sanjo:jasmine]: loading source file: /home/jimmie/Documents/project/lib/routes/config.js
W20150326-10:55:08.093(-5)? (STDERR) [sanjo:jasmine]: The file "/home/jimmie/Documents/project/lib/collections/user.js" has syntax errors. [TypeError: Object [object Object] has no method 'attachSchema']
所以我的存根似乎没有正确设置,尽管它们似乎在测试之前加载。
好的,我有两个问题。
首先,我应该坚持的原型是
Mongo.Collection
并且文件需要在 test/jasmine/server/unit/
中才能使加载顺序正确。
我不确定同时为客户端和服务器提供正确的加载顺序和存根需要什么。