Add support for namespaced suites for JavaScript unit tests.

Review Request #5727 — Created April 22, 2014 and submitted

Information

Review Board
release-2.0.x
5926542...

Reviewers

Unit tests using Jasmine consist of files each wrapping a series of
tests and definitions in one big describe() call. For organization,
we've been using the convention of namespacing these, in order to see
whether a test suite is part of, say, the API resources code, or the
diffviewer views code, allowing for easily searching on the page.
However, this still makes it hard to run a subset of tests, when they
span multiple files.

This introduces a new Jasmine utility library, jasmine.suites, which
allows us to replace that big describe() all with a suite() call. This
will generate describe() calls for us, reusing existing ones for
previously registered levels of the namespace tree. The result is that,
instead of running all tests to see if all resource tests pass, we can
now just run the "resources" suite independently. It's equivalent to
moving all tests into one big file and wrapping the resources tests in
its own big describe() call.

This utility library will be released externally as its own independent
module, but I'm putting it here for review purposes for now.

Converted all unit tests in RB and Djblets to use this. All tests ran,
and I saw the same test count as before they were ported over.

I was able to run various suites of tests, and didn't see any duplicates
or any issues running them.

david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (f92e526)
Loading...