parse-mock
parse-mock copied to clipboard
How to get parameter from stub of "Parse Query Get" method ?
new Parse.Query('User').get(1).then(function(user){...});
here is my test code, is it possible to use stub like this ?
var stub = Parse.Mock.stubQueryGet(function(options) { if (options == 1) return mockUser1; else if (options == 2) return mockUser2; });
after I change line 33, it seems working :) , but I am not sure it's a good solution.
return registerStub(sinon.stub(object, methodName, function (options) { var promise = new Parse.Promise()._thenRunCallbacks(options), data = cb.call(this, queryToJSON(this), options); <===