Free Sample
+ Collection

JavaScript Unit Testing

Hazem Saleh

This book covers the most popular modern JavaScript Unit testing frameworks and gives you a crash course in how to use and automate them. Lots of examples and practical instructions make learning easy and enjoyable.
RRP $14.99
RRP $29.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782160625
Paperback190 pages

About This Book

  • Learn and understand, using practical examples, synchronous and asynchronous JavaScript unit testing
  • Cover the most popular JavaScript Unit Testing Frameworks including Jasmine, YUITest, QUnit, and JsTestDriver
  • Automate and integrate your JavaScript Unit Testing for ease and efficiency

Who This Book Is For

JavaScript Unit Testing is a must have guide for every web developer, designer, architect, and JavaScript coder seeking to ensure the highest  quality of their web applications and JS code. Knowledge of JavaScript is assumed.

Table of Contents

Chapter 1: Unit Testing JavaScript Applications
What unit testing is
Why we need unit testing
What Test-Driven Development (TDD) is
Complexities in testing JavaScript applications
Weather forecasting application
Chapter 2: Jasmine
Writing your first Jasmine test
The nested describe blocks
Jasmine matchers
Testing asynchronous (Ajax) JavaScript code
HTML fixtures
Testing the weather application
Chapter 3: YUI Test
Writing your first YUI test
Testing asynchronous (Ajax) JavaScript code
Testing the weather application
Automation and integration with build management tools
Chapter 4: QUnit
Writing your first QUnit test
Testing asynchronous (Ajax) JavaScript code
Testing the weather application
Chapter 5: JsTestDriver
Writing your first JSTD test
Testing asynchronous (Ajax) JavaScript code
Testing the weather application
Integration with other JavaScript test frameworks
Integration with build management tools
Integration with the IDEs

What You Will Learn

  • Learn and use the power of Jasmine, YUITest, QUnit, and JsTestDriver
  • Learn by doing to synchronously and asynchronously test your JavaScript applications
  • Automate your JavaScript tests using both Build and Integration Management Tools
  • Generate test reports for your JavaScript tests
  • Customize JavaScript unit testing frameworks to include rich test expressions

In Detail

The largest challenge for many developers’ day to day life is ensuring the support of, and assuring the reach of, their product. With the ever increasing number of mainstream web browsers this is becoming a more difficult task for JavaScript coders.

From the beginning, JavaScript Unit Testing will show you how to reduce the time you spend testing, and automate and ensure efficiency in guaranteeing your success.

JavaScript Unit Testing will introduce and help you master the art of efficiently performing and automating JavaScript Unit tests for your web applications.

Using the most popular JavaScript unit testing frameworks, you will develop, integrate, and automate all the tests you need to ensure the widest reach and success of your web application.

Covering the most popular JavaScript Unit testing frameworks of today, JavaScript Unit Testing is your bible to ensuring the functionality and success of all of your JavaScript and Ajax Web Applications.

Starting with Jasmine, you will also learn about, and use, YUITest, QUnit, and JsTestDriver, integrate them into your projects, and use them together to generate reports.

Learn to automate these tools, make them work for you, and include the power of these tools in your projects from day one.


Read More