Closed hocnguyen closed 7 years ago
@hocnguyen Thank you for creating p-r!
Could you separate p-r for issue #161 or add description in p-r summary ? And I can't find test code for this fixing.
@ykokw Thanks for your review. I will separate to 2 p-r.
@ykokw I remove the code of issue 161. This is only code fixing of issue 132. Please help me review again!
@hocnguyen I've confirmed that your fixing is separated to 2 p-r. Thanks. Could you add test code or tell me procedure for confirmation?
@ykokw
About this issue, when we call logout function with a session token was expired or wrong.
The error will appear.
Base from description of issue. I reset session info to null value when error code response is 401.
Because In mbaas.yml file, we had declare logout function with response 200.
So I can`t create response 401 with logout function from test code.
That is reason i can`t add the test code.
But Please see example code bellow. That is my code test on this issue :
var user = new ncmb.User({userName:"Yamada Tarou", password:"password"});
ncmb.User.login(user)
.then(function(data){
// reset wrong token to error appear when logout
user.sessionToken="wrong token";
user.logout(function(err, res){
if(err){
console.log(err);
}
});
})
.catch(function(err){
// エラー処理
});
Because In mbaas.yml file, we had declare logout function with response 200.
上記、mbaas.ymlに401エラーが返るスタブを用意することで
テストコードが実装可能になるかと思います。
概要(Summary)
動作確認手順(Step for Confirmation)
Run the unit test.