Overview

Documents the approach to javascript unit testing and how such tests are organized.

Coverage

The main business logic and flow of the mapping tool is defined in the Javascript client layer.  It would be appropriate to comprehensively unit test the various javascript libraries (and corresponding partials pages) to ensure they function properly.

As with other forms of testing in this application, unit testing may prove difficult as many of the javascript functions perform REST calls to a service that will only make useful replies in the event that a full environment is properly loaded.  While one could create a "mock" or testing server that would respond in expected ways to the various REST calls, this was out of scope for the development of the project.

To properly define coverage, we would likely want to look at each of the widgets and the overall application code as well and ensure there was proper testing for each scope function defined therein.

Coverage Definition

NOTE: there is no formal coverage definition for javascript unit testing at this time.

Organization

Unit testing for Javascript applications is very different than for java applications and typically makes use of Node.js and third party frameworks like Karma and Jasmine.  A proper javascript unit testing architecture would likely involve at least one additional project.

  • No labels