Testing the subapplication Façade

The subapplication façade's responsibility is to create the model or collect objects and create the appropriate subapplication controller to render the fetched data. To show the contact editor, the Façade should fetch the contact by its ID and then run the ContactEditor subapplication:

var proxyquery = require('proxyquireify')(require); var FakeApp = require('../../fakes/app'); var FakeRegion = require('../../fakes/region'); var FakeContactEditor = require('../../fakes/contactEditor'); var fakes = { '../../app': FakeApp, './contactEditor': FakeContactEditor, './contactList': {}, './contactViewer': {} }; var ContactsApp = proxyquery('../../../app/js/apps/contacts/app', fakes); describe('Contacts application facade', ...

Get Mastering Backbone.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.