SoftwareTesting:Tools:jsUnit

Revision as of 23:07, 15 September 2006 by Davel (talk | contribs) (checkpoint)
  • example jsunit-based tests (davel's examples)
    • urls in test suite pages are resolved relative to the url of the test runner page, not the url of the test suite page
    • can we use chrome urls (with appropriate manifest files) to access the jsunit core js files in a path-independent manner? this means we just have to worry about the test runner page and the test suite/case pages.
    • this is only a problem for packaging jsunit-based tests in our tree so that they point to the same core jsunit files

Description

jsUnit is a fairly mature harness for in-browser testing. We can easily use it to run tests that can run as content

How to run the test

  1. download jsunit from jsunit.net
    • I've had success playing with 2.2a11
  2. unzip the file
    • I didn't do any of the installation stuff for jsUnit Server - I just used the unpacked files as-is
  3. add your test to the jsunit directory (the one containing testRunner.html)
  4. load testRunner.html in your browser
  5. use the file picker to select the test you just wrote
  6. run the test

Example

Output

Comments

  • jsUnit also supports test suites.
    • paths for files in addTestPage() are evaluated relative to the testRunner page, not the test suite page

To do list