Cover image for JavaScript Unit Testing.
JavaScript Unit Testing.
Title:
JavaScript Unit Testing.
Author:
Saleh, Hazem.
ISBN:
9781782160632
Personal Author:
Physical Description:
1 online resource (214 pages)
Contents:
JavaScript Unit Testing -- Table of Contents -- JavaScript Unit Testing -- Credits -- About the Author -- About the Reviewer -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 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 -- 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 -- 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 -- 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 -- 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 -- Index.
Abstract:
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.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: