Skip to content

Commit

Permalink
Makes sure we wait for the logout
Browse files Browse the repository at this point in the history
- Parse.User.logOut is async and was making a test flaky
  • Loading branch information
flovilmart committed May 28, 2017
1 parent 81ca86f commit a0d0520
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec/ParseUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,20 +1271,20 @@ describe('Parse.User testing', () => {
Parse.User._registerAuthenticationProvider(provider);
Parse.User._logInWith("facebook", {
success: function() {
Parse.User.logOut();

Parse.Cloud.beforeSave(Parse.User, function(req, res) {
res.error("Before save shouldn't be called on login");
});
Parse.User.logOut().then(() => {
Parse.Cloud.beforeSave(Parse.User, function(req, res) {
res.error("Before save shouldn't be called on login");
});

Parse.User._logInWith("facebook", {
success: function() {
done();
},
error: function(model, error) {
ok(undefined, error);
done();
}
Parse.User._logInWith("facebook", {
success: function() {
done();
},
error: function(model, error) {
ok(undefined, error);
done();
}
});
});
}
});
Expand Down

0 comments on commit a0d0520

Please sign in to comment.