init and run jasmine
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 20 Aug 2013 14:50:47 +0000 (16:50 +0200)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 20 Aug 2013 14:50:47 +0000 (16:50 +0200)
test/README.txt
test/js/mkws-jasmine-run.js [new file with mode: 0644]

index 663450f..ff2215f 100644 (file)
@@ -2,6 +2,8 @@ Jasmine / jasmine-node test frame works
 -------------------------------------
 
 ./spec         contains *spec.js files
+./js           jasmine runtime JS lib
+       
 README.txt     this file
 
 Documentation
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();
+       }
+
+      })();
+