cloudchen / grunt-template-jasmine-requirejs

RequireJS template for grunt-contrib-jasmine task
111 stars 96 forks source link

Wait for the dom to be ready #69

Closed sbryfcz closed 9 years ago

sbryfcz commented 10 years ago

I am using some libraries that require the dom to be loaded and ready before the tests are run. Is there any way to specify that in the template? Or if you all know a better way, I'm open for ideas. Typically in my jasmine runner file I just wrap my function in a $(function () {}) call from jquery. Any suggestions would be great. Thanks!

cloudchen commented 10 years ago

Some libraries wihich depend on dom to be ready should be loaded as dependencies of your actual AMD module. Because they are just dependencies, you should control whatever dependencies that will be loaded and how to load them. It has nothing to with this template. If those libraries need to be loaded unitil DOM ready, you have to explicitly contorl it since that's code logic. Hope that does work for you.