You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using karma-jasmine: 0.3.5. I have tests that run perfectly from a HTML runner that loads jasmine 2.2 but when I run them through karma using karma-jasmine they fail. I have investigated the problem and it seems that the tests start executing before the DOM is ready (which is not the case when run from a HTML runner). After updating the createStartFn function in the adapter.js file to the code below which waits for the DOM ready the tests started passsing.
functioncreateStartFn(karma,jasmineEnv){// This function will be assigned to `window.__karma__.start`:returnfunction(){$(function(){jasmineEnv=jasmineEnv||window.jasmine.getEnv();jasmineEnv.addReporter(newKarmaReporter(karma,jasmineEnv));jasmineEnv.execute();});};}
The text was updated successfully, but these errors were encountered:
@astoilkov yup, You are right. Tests start before DOM is completed, but it's not issue of karma-jasmine, it is issue of karma. Because karma call start function.
As workaround you can create file jasmine-global.js which contain code:
I am using karma-jasmine: 0.3.5. I have tests that run perfectly from a HTML runner that loads jasmine 2.2 but when I run them through karma using karma-jasmine they fail. I have investigated the problem and it seems that the tests start executing before the DOM is ready (which is not the case when run from a HTML runner). After updating the createStartFn function in the adapter.js file to the code below which waits for the DOM ready the tests started passsing.
The text was updated successfully, but these errors were encountered: