How to unit test a meteor 'method'


I’m using the recommended meteor-mocha. I don’t even understand if ‘methods’ could be unit tested or not. I’m new to meteor, and I’m totally stumped.


Take a look at the Guide’s reference app todos. It includes a few unit tests for its Methods. For example, the list methods have unit tests defined here.


I did look at that. He hasn’t used any functions in Meteor.methods() in the application. I’m having trouble accessing a function defined in Meteor.methods() from server-side test file.


The test is using Meteor validated methods e.g. here (on top of Meteor.methods)

Validated method has method _execute for test code