In this step, we will step back from our tests and application features that we have implemented so far and add another important piece of test code: The test suite page. A test suite can execute multiple tests and collect the results. This comes in handy for automatic tools in a continuous integration process.
You can view and download all files in the Explored app in the Demo Kit under Testing - Step 10.
The coding is quite straight-forward, we require the relevant QUnit files for redirecting to the central test suite and provide a configuration function suite() that is called automatically by the testrunner.
A similar test suite can be configured as a pre-commit hook in local build environments or as a pre-submit hook in a continuous integration scenario on the central build server. Only when all tests run successfully, a new change is accepted and may be merged.
Alternatively you can use a local test runner, such as Selenium or Karma, that automatically executes all tests whenever a file in the app project has been changed. All of these configurations run the tests and collect the resulting messages for further analysis. Therefore, it is very important to define meaningful test descriptions and success as well as error messages as you write your application tests.
Create a test suite app that triggers all your tests at once
Run the test suite whenever you change the code of the app