Book Image

Mastering jQuery

By : Alex Libby
Book Image

Mastering jQuery

By: Alex Libby

Overview of this book

<p>Mastering jQuery has been written not only to help maximize your skills with core functionality in the library, but also to explore some of the more intriguing ways of using the library to achieve real-world solutions that could feature on any website or online environment.</p> <p>You'll start with a look at some of the more advanced ways to incorporate the library into your pages, followed by working with forms and advanced form validation using regular expressions. Next you'll move on to animating in jQuery, advanced event handling, and using jQuery effects.</p> <p>Finally, you will develop practical examples of using jQuery with external functionality such as node-webkit, before finishing with a session on optimizing your version of the library for maximum efficiency and exploring best practices for using QUnit.</p>
Table of Contents (21 chapters)
Mastering jQuery
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 14. Testing jQuery

To test or not to test, that's the question…

To paraphrase that world-famous detective, the answer to this question should be elementary!

If you've spent any time with jQuery, you will no doubt be aware of its unit: the need to test code, and that the most popular way is to use its testing library, QUnit. Throughout this chapter, we'll recap how to use it and then look at some of the best practices we should use as well as explore how we can really cut down our workflow effort, by automating the tests we perform on our code.

In this chapter, we'll cover the following topics:

  • Revisiting QUnit

  • Automated testing using NodeJS and RequireJS

  • Best practices when using QUnit

Are you ready to get stuck in? Let's get started…