Add sp_auth_credentials setting for tpl.html
[mkws-moved-to-github.git] / test / js / mkws-jasmine-run.js
1 /*
2  * init and run jasmine
3  *
4  * a given delay starts the test N miliseconds later
5  */
6
7 function mkws_jasmine_init(delay) {
8     var currentWindowOnload = window.onload;
9
10     window.onload = function () {
11         if (currentWindowOnload) {
12             currentWindowOnload();
13         }
14         if (delay) {
15             setTimeout(function () {
16                 execJasmine()
17             }, delay);
18         } else {
19             execJasmine();
20         }
21     };
22
23     function execJasmine() {
24
25         var jasmineEnv = jasmine.getEnv();
26         jasmineEnv.updateInterval = 1000;
27         var htmlReporter = new jasmine.HtmlReporter();
28         jasmineEnv.addReporter(htmlReporter);
29
30         jasmineEnv.specFilter = function (spec) {
31             return htmlReporter.specFilter(spec);
32         };
33
34         jasmineEnv.execute();
35     }
36 };
37
38 mkws.$(document).ready(function () {
39     mkws_jasmine_init(0);
40 });
41
42 /* EOF */