Skip to content
janodvarko edited this page Nov 11, 2014 · 7 revisions

Learn how to write unit tests for Firebug code base.

Running Firebug Test Suite

The first thing you want to usually do before implementing a new test is setup your test environment and run the existing test suite to make sure all is up and running.

  1. git clone https://github.com/firebug/firebug.next.git
  2. Make sure you have an updated copy of Firefox Nightly installed.
  3. Make sure you have npm & jpm installed. Read instructions.
  4. Install Firebug's dependencies by running npm install in the source directory (created in step 1).
  5. Run tests using jpm test -b nightly -v in the source directory.

Travis

Firebug repository is integrated with Travis. You can see the build status here.

Addon-httpd

Firebug uses addon-httpd module (see devDependency in package.json) as HTTP server for tests (see MDN).

JPM Tips & Tricks

  • In order to run only specific tests use --filter=FILENAME[:TESTNAME]. This only run tests whose filenames match FILENAME and optionally match TESTNAME, both regexps. For example: if you specify --filter data, then jpm will only run tests in those modules whose name contain the string "data".

  • Use --do-not-quit to avoid closing the browser window after test finishes. This is especially useful when you want to check the browser console for errors (and you need time).

Test API

TODO