drewdeponte / snapdragon

A Jasmine JavaScript test runner that lets you run tests on the command-line similar to RSpec.
Other
6 stars 8 forks source link

fix HtmlReporter error observed when only describe block added to spec #26

Closed prasadc82 closed 11 years ago

prasadc82 commented 11 years ago

The below error is thrown when a spec only has "describe" block no "it" block, no real tests in the spec. traced down to HtmlReporter, added a null check before the function call.

TypeError: 'undefined' is not an object (evaluating 'reporterView.suiteComplete') at http://127.0.0.1:52047/jasmine-core/jasmine-html.js:92 at http://127.0.0.1:52047/jasmine-core/jasmine.js:1788 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2475 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2522 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2106 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2049 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2523 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2096 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2049 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2523 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2096 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2049 at http://127.0.0.1:52047/jasmine-core/jasmine.js:2145 at http://127.0.0.1:52047/jasmine-core/jasmine.js:802

drewdeponte commented 11 years ago

@prasadc82 it seems that you have monkey patched the HtmlReporter. You should instead submit the fix for the HtmlReporter to the jasmine project as https://github.com/pivotal/jasmine repository as it is what provides that. Therefore I am closing this pull request and denying it. If you think I am wrong in some way and have an argument for why this should belong in snapdragon I am open to hear it.