Preface

JavaScript web applications are soaring in popularity and driving exciting new application possibilities across the Internet. One of the most ubiquitous frameworks leading this charge is Backbone.js, which provides a modern and rational approach for organizing JavaScript applications.

At the same time, testing client-side JavaScript and Backbone.js applications remains a difficult and tedious undertaking. Even experienced developers can stumble across issues related to browser idiosyncrasies, complex DOM interactions, and asynchronous application behavior when writing frontend tests.

Backbone.js Testing brings sensible practices and current techniques to the challenges of Backbone.js test development. You will be introduced to fundamental testing concepts, a contemporary frontend test infrastructure, and practical exercises on all facets of Backbone.js application development. This book covers topics ranging from basic test suite creation to using test doubles to tackle even the most difficult/least testable Backbone.js application components.

With a little guidance from this book, you can test your Backbone.js web applications easily, quickly, and with confidence.

What this book covers

Chapter 1, Setting Up a Test Infrastructure, starts with the basics of how to set up your test application code and obtain the test libraries that we will use throughout this book. We create a basic test infrastructure, write the first tests, and review the test report results.

Chapter 2, Creating a Backbone.js Application Test Plan, begins with a refresher of Backbone.js fundamentals, introduces a sample web application for the book, and discusses a wide range of relevant testing and planning concepts. We conclude by writing and running our first Backbone.js application tests.

Chapter 3, Test Assertions, Specs, and Suites, covers the basics of writing Backbone.js test suites and specs with Mocha and test assertions with Chai.

Chapter 4, Test Spies, introduces the Sinon.JS test double library and how to spy on application method behaviors in Backbone.js tests.

Chapter 5, Test Stubs and Mocks, dives deeper into Sinon.JS, with stubs and mocks that can replace application method behaviors. We examine how stubs and mocks can reduce application dependencies in tests and facilitate easier and more tractable Backbone.js application tests.

Chapter 6, Automated Web Testing, enhances the test infrastructure built in the previous chapters to run automatically, for example, from the command line or a continuous integration server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.4.44