Now, we come to developing the QUnit tests for our weather application. Actually, after you have learned how to write QUnit tests for both synchronous and asynchronous JavaScript (Ajax) code, testing the weather application is an easy task. As you remember from the previous chapters, we have three major JavaScript objects in the weather application that we need for developing tests for the LoginClient
, RegistrationClient
, and WeatherClient
objects.
Two subfolders qunit
and tests
are created under the js-test
folder (thus: qunit\tests
) for containing the QUnit tests, and the lib
folder is created under the qunit
folder (thus: qunit\lib
) for containing QUnit library files, as shown in the following screenshot:
The tests
folder contains three main JavaScript files (LoginClientTest.js
, RegistartionClientTest.js
, and WeatherClientTest.js
) for testing the weather application's corresponding JavaScript objects. The QUnit test runner file testRunner.html
is placed directly...