PacktLib: Jasmine JavaScript Testing

Jasmine JavaScript Testing

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started with Jasmine

JavaScript – the bad parts

Jasmine and Behavior-Driven Development

Downloading and first run

Summary

Your First Spec

The Investment Tracker application

Jasmine basics and thinking in BDD

Setup and teardown

Nested describes

Understanding matchers

Summary

Testing Frontend Code

Thinking in terms of components (Views)

The module pattern

Using HTML fixtures

Basic View coding rules

Testing Views with jQuery matchers

Summary

Asynchronous Testing – AJAX

Setting up the Scenario

Writing the spec

Summary

Jasmine Spies

The "bare" Spy

Spy an object's functions

Testing DOM events

Summary

Light Speed Unit Testing

Jasmine Stubs

Sinon.JS

Summary

Testing Backbone.js Applications

The Backbone model

Testing Backbone collections

Testing Backbone Views

Testing Backbone routers

Summary

Build Automation

RequireJS

Headless testing with PhantomJS

Grunt

Managing NPM dependencies

Summary

Conclusion

Index