How to test forgotPassword method in meteor using mocha?


#1

describe(“validating user”, function(){
it(“expect to be true”, function(){
Meteor.call(‘sendResetPassword’,‘veda@gmail.com’, (error, result)=>{
if(error){
console.log(error);
}
else{
console.log(result);
}

 });

});
});

any help?

thanks in advance.


#2

I wouldn’t recommend writing tests to test Accounts.forgotPassword or Accounts.sendResetPasswordEmail directly; Tests for these are already included alongside the Meteor source, and are run on each Meteor build. Instead, I’d just head down the path of verifying that Accounts.forgotPassword is called when it should be, with the proper parameters. Something like: