Appendix B. How jQuery UI tests jQuery UI

To verify that the various features of jQuery UI work as intended, the library has a series of unit tests that run in all the library’s supported browsers. The tests themselves are written using the QUnit testing library. Because several excellent QUnit tutorials are online (http://qunitjs.com/cookbook/ is a particularly good one), I won’t give one here. Instead, I’ll show how jQuery UI tests its own widgets, using examples directly from the jQuery UI source code. Hopefully, looking at how jQuery UI tests its own widgets will help you approach testing yours.

B.1. Testing options

jQuery UI attempts to test every potential value of every option for every widget. Although the test coverage isn’t perfect, ...

Get jQuery UI in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.