Skip to content

Instantly share code, notes, and snippets.

@Azeirah
Created August 28, 2014 15:06
Show Gist options
  • Save Azeirah/e14ca60b891b54639279 to your computer and use it in GitHub Desktop.
Save Azeirah/e14ca60b891b54639279 to your computer and use it in GitHub Desktop.
Failing async tests at creating two accounts
Tinytest.addAsync('test', function (test, done) {
if (Meteor.isClient) {
Accounts.createUser({
username: 'user1',
password: 'fruit'
}, function (err) {
Accounts.logout(function () {
Accounts.createUser({
username: 'user2',
password: 'fruit'
}, function (err) {if (err) console.log(err);});
});
});
}
Meteor.setTimeout(function () {
test.isUndefined(Meteor.users.findOne({username: 'user1'}));
test.isUndefined(Meteor.users.findOne({username: 'user2'}));
done();
}, 2000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment