unit testing improvements

unit testing improvements

<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">So I recently found this blog from John:<DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN><A href="http://ejohn.org/blog/tags/rhino/"> http://ejohn.org/blog/tags/rhino/</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I use this framework locally with a few small patches and now finally understand why I dont like jsUnit, because I cant simulate a browser and treat my code like a language and not just another '@%#!' to be slapped around by the browsers.  I normally test first for common issues right for the command line so John's browsers emulater is spectacular. John did mention that the code for this test runner had gotten a bit behind and I am currently facing a project development issue where I'm either forced to use jsUnit or prove the current jquery unit test framework can be improved.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The problems I have with the current frame work is that:</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>1: there are two different test runners, one for rhino and one for browsers and I think this needs to be abstracted out.  obviously 'print' means significantly different things in each, and 'load' isnt available in general, etc</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>2: there's not really any general exception handling in the runners and tests dont get reported as failling if they are not executed because an exception prevents it</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>3: there is no concept of atomic tests.  this is crucial to a test being a 'unit'.  setup - test - tear down.  repeat.  its slow but who care because it's not about speed when we unit test.  </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>4: reporting is lacking something pretty useful.  </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Also since it seems like trac is used on the dev side of things it would be nice to integrate something like cruise control for trac: </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN><A href="https://oss.werkbold.de/trac-cc"> https://oss.werkbold.de/trac-cc</A> </DIV><DIV>so we can start to see builds break every night.  We are currently doing this and jquery is getting too big to let developers check in code that breaks even if it's not core.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I can volunteer to lead this area of development, or if there is someone in charge of the unit tests I'm happy to be under their direction.  </DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Chris Thatcher</DIV><DIV>(cell) 202 340 9685</DIV><DIV><A href="mailto:christopher.thatcher@comcast.net"> christopher.thatcher@comcast.net</A></DIV><DIV><A href="mailto:chth@loc.gov"> chth@loc.gov</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR></DIV>