Showing Passed Jasmine Tests by Default

Comments

Jasmine HTML page with all passed tests opened.

I am sure I have missed an obvious config setting, but the quickest way I found to display passed tests in Jasmine when the page loads, without having to click on the checkbox, is with a JS function that uses the proxy / decorator pattern.

1
2
3
4
5
6
7
8
9
10
11
(function(){
  var proxied = jasmine.TrivialReporter.prototype.reportRunnerResults;
  jasmine.TrivialReporter.prototype.reportRunnerResults = function(){
    proxied.apply(this, arguments);

    $( '#__jasmine_TrivialReporter_showPassed__' )
      .trigger( 'click' )
      .trigger( 'click' ) //on chrome, two are needed...
      .attr( 'checked', true );
  }
})();

Comments