- Verify that expected behaviors are supported by all supported browser environments.
- Be simple to run (simply loading: TestSuite.html into your browser runs all of the unit tests for the NST project).
- Test service based behaviors (AJAX based features are difficult to unit test).
- Test modifications to the active document (DOM changes are difficult to unit test).
- Test visual renderings or appearance of rendered pages.
Before proceeding with unit testing, it is recommended that you are familiar with:
- Have a basic understanding of what unit testing means.
- Using a web browser to load HTML pages directly from your file system.
To add unit testing capabilities to a existing project, create a sub-directory named test and install the following files into it:
- This file provides some style information for display the results of running the unit tests within a HTML page.
- This file can be saved as TestSuite.html. It will become the file you load into your web browser when you want to run your unit tests.
- This file provides an example set of unit tests (for a function in the UnitTest.js file). You won't need this file in the long run, but it is loaded and run by the default TestSuiteTemplate.html template file.