Now we come to developing the YUI tests for our weather application. Actually, after you know how to write YUI tests for both synchronous and asynchronous JavaScript (Ajax) code, testing the weather application is an easy task. As you remember from the previous two 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, yuitest
and tests
, are created under the js-test
folder (thus: yuitest\tests
) to contain the YUI tests, as shown in the following screenshot:
Because currently YUI Test does not have an API to load the HTML fixtures, they are included as part of the HTML test runner pages. As shown in the preceding screenshot, there are three HTML files that contain the HTML fixtures for every test—LoginClientTest.html
, RegistrationClientTest.html
, and WeatherClientTest.html
. Every HTML file also includes the source and test JavaScript...