I am using proven methods ( mdg:validated-method ) with LoggedInMixin ( tunifight:loggedin-mixin ).
Now I have a problem with my unit tests, because they fail with the notLogged error, because of course, the user is not registered in unit tests. How do I need to drown it out?
method
const resetEdit = new ValidatedMethod({ name: 'reset', mixins: [LoggedInMixin], checkLoggedInError: { error: 'notLogged' }, // <- throws error if user is not logged in validate: null, run ({ id }) { // ... } })
unit test
describe('resetEdit', () => { it('should reset data', (done) => { resetEdit.call({ id: 'IDString' }) }) })
Unit tests throw Error: [notLogged] .
javascript unit-testing meteor stub
user3142695
source share