arunoda / laika

testing framework for meteor
http://arunoda.github.io/laika/
MIT License
242 stars 38 forks source link

Where to put helper method? #113

Open hamxiaoz opened 10 years ago

hamxiaoz commented 10 years ago

I tried to create a helper method out of test suite and I get this error: Uncaught ReferenceError: helperMethod is not defined

iansinnott commented 10 years ago

Try putting it anywhere in your tests/ directory while omitting 'var':

helperMethod = function() { /* Do stuff... */ };

Also check out this: https://github.com/zvictor/laika-extended-example

I'm not sure if there is a defined place for helpers, but this has been working for me by putting all helpers in tests/setup.js. The Laika documentation has a lot of room for improvement with regards to extensibility.