From: Wolfram Schneider Date: Tue, 20 Aug 2013 14:50:47 +0000 (+0200) Subject: init and run jasmine X-Git-Tag: 0.9.1~202^2~124 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=14c2dabff12b5b2d9c9d76dd0a5387ac921bc65c init and run jasmine --- diff --git a/test/README.txt b/test/README.txt index 663450f..ff2215f 100644 --- a/test/README.txt +++ b/test/README.txt @@ -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 index 0000000..f3364b6 --- /dev/null +++ b/test/js/mkws-jasmine-run.js @@ -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(); + } + + })(); +