Sure - what I'm doing is using '
require.js' [
http://requirejs.org/ ] to do script loading, and so I'm trying getting it to resolve all the script into the page before the test runs.
I think this is a more accurate testing situation (rather than have the Jasmine YML find and load all JS files automatically) because it ensure what I'm testing was setup the way it will actually run in production. In fact, not loading things this way causes errors anyhow when the JS files are spun up independently by Jasmine, as they aren't expecting all to be just loaded into the page - so not only is this better (I think), it's kind of necessary.
So, the call in the beforeEach would be something like this:
// Block here until require has finished.
require(['module1', 'module2'], function(module1, module2) {
// Done now .. unblock program flow so Jasmine can
// move on to executing the test.
I thought maybe a runs() closure would do the trick - but it doesn't seem to have an effect, and I may be missing the point of runs. It doesn't seem to block execution until it's completed ... should it?
Is what I'm saying crazy .... am I just approaching this wrong?
Thanks!