Meteor / Jasmine / Velocity : how to test a server method requiring logged in user?

前端 未结 4 1861
萌比男神i
萌比男神i 2021-02-15 17:50

Using velocity/jasmine, I\'m a bit stuck on how I should test a server-side method requiring that there be a currently logged-in user. Is there a way to make Meteor think a user

4条回答
  •  离开以前
    2021-02-15 18:42

    I think that Meteor.server.method_handlers["nameOfMyMethod"] allows you to call/apply a Meteor method and supply this as the first parameter at least in the current version (1.3.3)

    this.userId = userId;
    Meteor.server.method_handlers["cart/addToCart"].apply(this, arguments);
    

提交回复
热议问题