angular-meteor-server
angular-meteor-server copied to clipboard
Patch to make services created with angular-server testable
Make angular-server testable. When angular is setup again and again by unit or integration tests Meteor.methods() is called again and again with the same method object map. The current Meteor version throws an exception if a method is registered to Meteor.methods() more than once with the same method name. So this patch calls Meteor.methods() only with the method names the have not been registered before.
Hey @Ben305, Thanks for the PR! Can you provide a reproduction of tests failing because of that case? I'de like to have a look. I feel like using undocumented properties of Meteor is not the best way to go. Maybe other packages have a better solution for this, cause this seems like an issue that would be relevant to any package that registers methods...
Hi @netanelgilad,
I have created a sample project that you can use to reproduce the error: https://github.com/Ben305/AngularServerSample
You can start the tests using the the runTests.sh script