init and run jasmine
[mkws-moved-to-github.git] / test / js / mkws-jasmine-run.js
diff --git a/test/js/mkws-jasmine-run.js b/test/js/mkws-jasmine-run.js
new file mode 100644 (file)
index 0000000..f3364b6
--- /dev/null
@@ -0,0 +1,27 @@
+      (function() {
+       var jasmineEnv = jasmine.getEnv();
+       jasmineEnv.updateInterval = 1000;
+
+       var htmlReporter = new jasmine.HtmlReporter();
+
+       jasmineEnv.addReporter(htmlReporter);
+
+       jasmineEnv.specFilter = function(spec) {
+         return htmlReporter.specFilter(spec);
+       };
+
+       var currentWindowOnload = window.onload;
+
+       window.onload = function() {
+         if (currentWindowOnload) {
+           currentWindowOnload();
+         }
+         execJasmine();
+       };
+
+       function execJasmine() {
+         jasmineEnv.execute();
+       }
+
+      })();
+