Now, we come to developing the JSTD tests for our weather application. Actually, after you know how to write JSTD 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 to develop tests for: the LoginClient
, RegistrationClient
, and WeatherClient
objects.
Two subfolders, jstd
and tests,
are created under the js-test
folder (thus: jstd\tests
) to contain the JSTD tests, as shown in the following screenshot:
As shown in the preceding screenshot, there are three JSTD test files (LoginClientTest.js
, RegistrationClientTest.js
, and WeatherClientTest.js
) that test the main three JavaScript objects of the weather application.