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

Annotation

Bibliographic Details
Main Authors: Gupta, Ravi Kumar, Prajapati, Hetal (Author), Singh, Harmeet (Author)
Format: eBook
Language:English
Published: Birmingham, UK Packt Publishing 2015
Series:Community experience distilled
Subjects:
Online Access:
Collection: O'Reilly - Collection details see MPG.ReNa
Table of Contents:
  • 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
  • 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.
  • 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