PacktLib: Backbone.js Testing

Backbone.js Testing

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Setting Up a Test Infrastructure

Designing an application and test repository structure

Getting the test libraries

Setting up and writing our first tests

Running and assessing test results

Summary

Creating a Backbone.js Application Test Plan

A Backbone.js refresher

Selecting a Backbone.js application to test

Test paradigms and methods

Testing concepts, approaches, and planning

Testing individual Backbone.js components

Testing application interactions and events

Dipping our toes in the application testing waters

Running the application tests

Summary

Test Assertions, Specs, and Suites

Choosing a test style that fits

Trying out some different styles

A tour of the Chai assertion library

Getting the application and tests ready to run

Writing Mocha test specifications

Testing and supporting Backbone.js views

Aggregating and running the application tests

Test development tips, tricks, and hints

Summary

Test Spies

Fake it 'til you make it

Getting to know Sinon.JS

Spicing up Chai with the Sinon.JS plugin

Testing Backbone.js components with spies

Summary

Test Stubs and Mocks

Replacing method behaviors with Sinon.JS stubs

Faking and verifying behavior with Sinon.JS mocks

Testing Backbone.js components with stubs and mocks

Finding the rest of the Notes application components

A few more Sinon.JS test helpers

Summary

Automated Web Testing

The world of testing beyond humans and browsers

Automating browser environments

Headless testing with PhantomJS

Parting thoughts, next steps, and future ideas

Summary

Index