Blaze not available in Tinytest?


I think I’m suffering from some kind of conceptual misunderstanding here. I’d like to unit test a global Blaze helper, so I thought I could get it like this:


But I can’t get Blaze in my scope – even though I’ve added it to the list of used dependencies on the client.

The only way I’ve found to access it is through Package.blaze.Blaze.

What gives?


You need to add api.use('templating', 'client'); to the Package.onTest section of your package.js.


Yep, or api.use("blaze").


Blaze has become available after I’ve removed this line* from inside onTest:

// Resulted in Blaze not being present in client code

* I decided that I didn’t need templates for the tests