Download Backbone.js Testing by Ryan Roemer PDF
By Ryan Roemer
- Create accomplished try out infrastructures
- Understand and make the most of glossy frontend trying out options and libraries
- Use mocks, spies, and fakes to easily attempt and notice advanced Backbone.js software behavior
- Automate exams to run from the command line, shell, or essentially anywhere
The ebook progresses from Mocha try suites and Chai assertions to complicated attempt mocks and stubs with Sinon.JS. The considered necessary libraries and utilities are brought with in-depth examples and top practices for integration together with your purposes. The ebook publications you thru the attempt making plans and implementation strategies to your software types, perspectives, routers, and different Backbone.js components.
Backbone.js trying out supplies the instruments, examples, and information to check your Backbone.js internet purposes completely, quick, and with confidence.
What you'll research from this book
- Install and arrange a try infrastructure for spine applications
- Run, study, and comprehend Mocha attempt reports
- Tour the Chai statement library API with distinctive examples
- Write try suites and specifications with the Mocha try out framework
- Fake program habit in assessments utilizing Sinon.JS mocks, spies, and faux servers
This e-book is jam-packed with step by step tutorials and directions in recipe structure that will help you create attempt infrastructures and progressively develop your Backbone.js program improvement and checking out skills.
Who this booklet is written for
Read or Download Backbone.js Testing PDF
- Ext JS 4 Web Application Development Cookbook
Extra resources for Backbone.js Testing
Js"> Mocha TDD and Chai assert styles The Mocha TDD interface uses different names for the same basic units: • suiteSetup() and setup(): These are aliases for before() and beforeEach() • suiteTeardown() and teardown(): These are aliases for after() and afterEach() • suite(): This specifies a test suite (describe() in BDD) • test(): This defines a single test function (test() in BDD) The Chai assert style is usually associated with TDD-style tests and provides an assert object with single function assertions.
See the Chai API documentation for a full listing of aliases. Chaining objects and assertions Chai's BDD interface exposes objects that can be chained together to make test assertions more comprehensible. js. a("string") uses the chain objects to and be, which simply proxy through the eventual assertion. In this manner, Chai allows us to add any of the chain objects to, be, been, is, that, and, have, with, at, and of to form more naturally readable assertion statements. The statements a and an are available as both assertion chains and comparison functions.