Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is meteor code effectively unit testable?

I am currently looking into the meteor framework and this question immediately jumps to mind. Is code which I write (for example Template.xxx code or Template.xxx.events) actually testable in any way?

Of course you can test code which is not bound to the meteor runtime as you would any other code, but my impression is that most code you will write inside of meteor is somehow scoped to meteor and its functions.

like image 999
xen Avatar asked Aug 30 '12 14:08

xen


1 Answers

There doesn't seem to be any official test framework yet apart from the undocumented Tinytest (see the video tutorial) and its helpers, but you can always stub/mock out the Meteor framework API like I've done in this trivial example on github.

I imagine it could get a lot harder for non-trivial applications, so it's probably a good idea to separate core application logic away from Meteor API calls.

like image 125
dmayo3 Avatar answered Oct 20 '22 14:10

dmayo3