<script type="text/javascript">
  (function() {
      var jasmineEnv = jasmine.getEnv();

      jasmineEnv.updateInterval = 1000;

      if (navigator.userAgent.indexOf('PhantomJS') != -1) {
          jasmineEnv.addReporter(new jasmine.TapReporter());
      } else {
          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();
      }

  })();
</script>
