JavaScript unit testing : your comprehensive and practical guide to efficiently performing and automating JavaScript unit testing /
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 seeki...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Pub.,
2013.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; About the Reviewer; www.PacktPub.com; Table of Contents; Preface; 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 matcherThe 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; 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 testAssertions; 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 applicationIntegration 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: JsTestDriverArchitecture; 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