Test-driven JavaScript development learn JavaScript test-driven development using popular frameworks and tools

Learn JavaScript test-driven development using popular frameworks and tools About This Book Learn the life cycle of TDD and its importance in real-world application Gain knowledge about popular tools and analyze features, syntax, and how they help in JavaScript testing Implement test-driven programm...

Descripción completa

Detalles Bibliográficos
Otros Autores: Gupta, Ravi Kumar, author (author), Prajapati, Hetal, author, Singh, Harmeet, author
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham, England ; Mumbai, [India] : Packt Publishing 2015.
Edición:1st edition
Colección:Community experience distilled.
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009629914406719
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Authors; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Conventions; Chapter 1: Overview of TDD; Complexity of web pages; Understanding test-driven development; The need for testing; Types of testing; The life cycle of TDD; TDD microcycle; Agile and TDD; Benefits of TDD and common myths; Benefits; Myths; Summary; Chapter 2: Testing Concepts; Unit testing; Unit testing frameworks; YUI Tests; Following the process; Preparing the environment; Following the life cycle; Writing a test; Running the test and seeing if test fails
  • Writing a production codeRunning all tests; Cleaning up the code; Repeat; Using the browser console; setUp() and tearDown(); Test suites; Actions and assertions; Actions; Assertions; Benefits and pitfalls; Benefits of unit testing; Pitfalls of unit testing; Summary; Chapter 3: Testing Tools; JsUnit; Getting started; Writing tests; Running tests; QUnit; Getting started; Writing tests; Running tests; Karma with Jasmine; Getting started; Writing tests; Running tests; DalekJS; Getting started; Writing tests; Actions; Assertions; Running tests; Summary; Chapter 4: Jasmine
  • Understanding behavior-driven developmentSetting up Jasmine; describe and specs; Expectations; Matchers; Set up and tear down; Spies; Tracking spies using calls; Creating a custom spy; Jasmine clock; Creating a custom matcher; Creating a custom equality tester; Asynchronous calls; The Jasmine Ajax plugin; Nesting suites; Disabling suites and specs; Summary; Chapter 5: JsTestDriver; JsTestDriver; Overview; Getting started; Writing tests; Assertions; Capturing the browser; Restructuring your project; The configuration file; Running tests using the command prompt
  • Setting up JsTestDriver with IDERunning the tests; Running Jasmine specs; Code coverage; Summary; Chapter 6: Feature Detection; Understanding feature detection; Available methods and libraries; has.js; Writing custom tests; Modernizr; Downloading and setting up Modernizr; How it works; Using Modernizr; Polyfills; Loading polyfills; Supported browsers; Browser detection; User agent sniffing; Object detection; Features testing with Modernizr; CSS features; HTML5 features; Miscellaneous features; Plugins for additional tests; Modernizr methods; Modernizr.prefixed(); Modernizr.prefixedCSS()
  • Modernizr.mq()Modernizr.on(); Modernizr.atRule(); Modernizr.addTest(); Modernizr.testStyles(); Modernizr.testProp(); Modernizr.testAllProps(); Modernizr.hasEvent(); Modernizr._prefixes and Modernizr._domPrefixes; Undetectable features; Summary; Chapter 7: Observer Design Pattern; Overview; When to use it; Advantages; Disadvantages; Different implementations of the observer; Event dispatcher/listener; Publish/subscribe; Push versus pull; Sample code; Understanding patterns in API; Observer with topics; Observer pattern using jQuery.Callbacks; Implementing the observer pattern using TDD
  • Red step (code with error)