Backbone.js Testing

If you dread the business of testing JavaScript and Backbone.js web applications, this book is your guardian angel. In easy stages and lots of examples it takes you through the whole testing situation, introducing you to best practice and current techniques.
Preview in Mapt
Code Files

Backbone.js Testing

Ryan Roemer

If you dread the business of testing JavaScript and Backbone.js web applications, this book is your guardian angel. In easy stages and lots of examples it takes you through the whole testing situation, introducing you to best practice and current techniques.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $19.99
Save 49%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$39.99
$29.99 p/m after trial
RRP $19.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Backbone.js Testing Book Cover
Backbone.js Testing
$ 19.99
$ 10.00
Mastering Windows Penetration Testing Book Cover
Mastering Windows Penetration Testing
$ 39.99
$ 10.00
Buy 2 for $20.00
Save $39.98
Add to Cart

Book Details

ISBN 139781782165248
Paperback168 pages

Book Description

Frontend web applications are soaring in popularity and the Backbone.js library is leading this charge with a modular, lightweight approach for organizing JavaScript web applications. At the same time, testing client-side JavaScript and Backbone.js programs remains a difficult and tedious undertaking.

Backbone.js Testing brings sensible practices and current techniques to the challenges of Backbone.js test development. The book introduces fundamental testing concepts, comprehensive test infrastructure design, and practical exercises to easily and systematically test modern JavaScript web applications.

The book progresses from Mocha test suites and Chai assertions to advanced test mocks and stubs with Sinon.JS. The requisite libraries and utilities are introduced with in-depth examples and best practices for integration with your applications. The book guides you through the test planning and implementation processes for your application models, views, routers, and other Backbone.js components.

Backbone.js Testing gives you the tools, examples, and assistance to test your Backbone.js web applications thoroughly, quickly, and with confidence.

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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

What You Will Learn

  • Install and set up a test infrastructure for Backbone.js applications
  • Run, examine, and understand Mocha test reports
  • Tour the Chai assertion library API with detailed examples
  • Write test suites and specs with the Mocha test framework
  • Fake application behavior in tests using Sinon.JS mocks, spies, and fake servers

Authors

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: 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
Chapter 5: 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
Chapter 6: 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

Book Details

ISBN 139781782165248
Paperback168 pages
Read More

Read More Reviews

Recommended for You

Backbone.js Blueprints Book Cover
Backbone.js Blueprints
$ 29.99
$ 10.00
Backbone.js Patterns and Best Practices Book Cover
Backbone.js Patterns and Best Practices
$ 23.99
$ 10.00
JavaScript and JSON Essentials Book Cover
JavaScript and JSON Essentials
$ 17.99
$ 10.00
Node Security Book Cover
Node Security
$ 17.99
$ 10.00
Backbone.js Essentials Book Cover
Backbone.js Essentials
$ 19.99
$ 10.00
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 10.00