JavaScript Unit Testing
Formats:
save 15%!
save 33%!
Free Shipping!
| Also available on: |
|
- 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
Book Details
Language : EnglishPaperback : 190 pages [ 235mm x 191mm ]
Release Date : January 2013
ISBN : 1782160620
ISBN 13 : 9781782160625
Author(s) : Hazem Saleh
Topics and Technologies : All Books, App Testing, Java, Open Source
Table of Contents
PrefaceChapter 1: Unit Testing JavaScript Applications
Chapter 2: Jasmine
Chapter 3: YUI Test
Chapter 4: QUnit
Chapter 5: JsTestDriver
Index
- 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
- Exploring the application's HTML and JavaScript code
- Running the weather application
- Summary
- Chapter 2: Jasmine
- Configuration
- Writing your first Jasmine test
- The nested describe blocks
- Jasmine matchers
- The toBe matcher
- The toBeDefined and toBeUndefined matchers
- The toBeNull matcher
- The toBeTruthy and toBeFalsy matchers
- The toContain matcher
- The toBeLessThan and toBeGreaterThan matchers
- The toMatch matcher
- Developing custom Jasmine matchers
- Testing asynchronous (Ajax) JavaScript code
- The runs() function
- The waits() function
- The waitsFor() function
- The spyOn() function
- HTML fixtures
- Configuring the jasmine-jquery plugin
- The loadFixtures module
- Testing the weather application
- Testing the LoginClient object
- Testing the RegistrationClient object
- Testing the WeatherClient object
- Running the weather application tests
- Summary
- Chapter 3: YUI Test
- Writing your first YUI test
- Assertions
- The assert assertion
- The areEqual and areNotEqual assertions
- The areSame and areNotSame assertions
- The datatype assertions
- Special value assertions
- The fail assertion
- Testing asynchronous (Ajax) JavaScript code
- The wait and resume functions
- Testing the weather application
- Testing the LoginClient object
- Testing the RegistrationClient object
- Testing the WeatherClient object
- Running the weather application tests
- Generating test reports
- Automation and integration with build management tools
- Configuring YUI Test Selenium Driver
- Using YUI Test Selenium Driver in the weather application
- Integration with build management tools
- Summary
- Chapter 4: QUnit
- Configuration
- Writing your first QUnit test
- Assertions
- The ok assertion
- The equal and notEqual assertions
- The deepEqual and notDeepEqual assertions
- The expect assertion
- Developing custom QUnit assertions
- Testing asynchronous (Ajax) JavaScript code
- The stop and start APIs
- Testing the weather application
- Testing the LoginClient object
- Testing the RegistrationClient object
- Testing the WeatherClient object
- Running the weather application tests
- Summary
- Chapter 5: JsTestDriver
- Architecture
- Configuration
- Writing your first JSTD test
- Assertions
- The assert, assertTrue, and assertFalse([msg], expression) assertions
- The assertEquals and assertNotEquals([msg], expected, actual) assertions
- The assertSame and assertNotSame([msg], expected, actual) assertions
- The datatype assertions
- Special value assertions
- The fail([msg]) assertion
- Testing asynchronous (Ajax) JavaScript code
- AsyncTestCase, queue, and callbacks
- Testing the weather application
- Testing the LoginClient object
- Testing the RegistrationClient object
- Testing the WeatherClient object
- Configuring the proxy
- Running the weather application tests
- Generating test reports
- Integration with other JavaScript test frameworks
- Integrating JSTD with Jasmine
- Integrating JSTD with QUnit
- Integration with build management tools
- Integration with the IDEs
- Eclipse integration
- Summary
Hazem Saleh
Code Downloads
Download the code and support files for this book.
Submit Errata
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Sorry, there are currently no downloads available for this title.
- 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
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.
A practical, example-driven guide to using, automating, and integrating JavaScript Unit tests for the busy and conscientious JavaScript developer striving for excellence and success.
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.

