Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A simple unit test to demonstrate how to use RTD #102
The concept behind RTD unit testing framework is to test app code in a non-meteor context environment. This means Meteor objects, it's packages etc. are not available during testing. So, while I was testing a template function, there were alot of errors like 'undefined is not an object "Template.server_channels"'. To remove these error I tried following techniques:
Conclusion: This is the best approach I could think of to unit test Waartaa. Since alot of code has already been written in Waartaa and RTD follows TDD techinque. So I think the only way to unit test is to load only those files(by specifying it in test/karma.conf.js) which you want to unit test.
Let me know If this approach suits you.
PS: Please also look at the directory structure inside test/unit/client where the first test is placed.
I have merged your code here: https://github.com/waartaa/waartaa/tree/tests.
How do I run the tests?
I am getting the following error:
This might help: http://johnattebury.com/blog/2013/07/grunt-js-error