Skip to content

How to catch thrown errors? #169

@khaledkbadr

Description

@khaledkbadr

I have Meteor.method that throw errors. This method use before method hooks that throw an error. I'm using promises to test it. But the error throws before the expect can test it.

return server.promise(function (resolve, reject, data) {
        Meteor.call('Post.add', {content: 'sample content'}, function(err, result) {
          if(err) {
            reject(err);
          }
        });
      }).then(function (err) {
        expect(err).to.be.an('null');
      });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions