书目详情:
Backbone.js TestingTable of ContentsBackbone.js TestingCreditsAbout the AuthorAbout the Reviewerswww.PacktPub.comSupport files, eBooks, discount offers and moreWhy Subscribe?Free Access for Packt account holdersPrefaceWhat this book coversWho this book is forConventionsReader feedbackCustomer supportDownloading the example codeErrataPiracyQuestions1. Setting Up a Test InfrastructureDesigning an application and test repository structureGetting the test librariesMochaChaiSinon.JSSetting up and writing our first testsThe test driver pageAdding some testsRunning and assessing test resultsThe first test reportTest report actionsTest timing and slow testsTest failuresSummary2. Creating a Backbone.js Application Test PlanA Backbone.js refresherSelecting a Backbone.js application to testGetting acquainted with the Notes applicationThe anatomy of the Notes applicationTest paradigms and methodsTesting concepts, approaches, and planningTesting individual Backbone.js componentsModelsCollectionsTemplatesViewsRoutersUtilitiesTesting application interactions and eventsPartial integrationsEventsDipping our toes in the application testing watersNamespaceNote modelRunning the application testsSummary3. Test Assertions, Specs, and SuitesChoosing a test style that fitsMocha test interfacesChai assertion stylesTrying out some different stylesMocha and Chai BDD interfacesMocha TDD and Chai assert stylesDeciding on the project styleA tour of the Chai assertion libraryChaining objects and assertionsBasic value assertionsComparing valuesObject and array validationErrorsGetting the application and tests ready to runThe Mocha test runnerReconfiguring the application for testingOrganizing topics and specifications into test suitesStarting up and winding down testsWriting Mocha test specificationsAsynchronous behavior in testsSome Backbone.js collection testsTesting and supporting Backbone.js viewsThe Notes application single note viewCreating HTML fixtures for view testsWalking through the view test suiteAggregating and running the application testsTest development tips, tricks, and hintsIsolating and excluding testsWriting testable application codeSummary4. Test SpiesFake it til you make itGetting to know Sinon.JSSpying on functions with Sinon.JSAnonymous spiesSpy assertionsFunction spiesObject method spiesPlaying in the sandbox with Sinon.JS test helpersDelving into the Sinon.JS spy APIThe spy APIThe spy call APISpicing up Chai with the Sinon.JS pluginIntroducing and installing Chai pluginsThe Sinon.JS pluginTesting Backbone.js components with spiesThe Notes menu bar viewThe menu bar viewTesting and spying on the menu bar viewThe Notes single note viewThe single note viewTesting the single note viewHooking up and running the view testsSummary5. Test Stubs and MocksReplacing method behaviors with Sinon.JS stubsGetting started with stubsThe stub APIFaking and verifying behavior with Sinon.JS mocksDeciding when to mockThe mock APITesting Backbone.js components with stubs and mocksEnsuring stubs and mocks are actually boundThe Notes list item viewThe list item viewTesting the list item viewThe Notes application routerRunning the view and router testsFinding the rest of the Notes application componentsA few more Sinon.JS test helpersFake timersFake serversThe fake server APIFaking the remote backend in a Backbone.js applicationSummary6. Automated Web TestingThe world of testing beyond humans and browsersContinuous integrationContinuous deploymentOther scenariosAutomating browser environmentsRemote controlled web browsersSimulated browser environmentsHeadless web browsersMultiple environment aggregatorsHeadless testing with PhantomJSInstalling PhantomJS and the supporting toolsRunning Backbone.js tests with PhantomJSAutomating tests in the code samplesParting thoughts, next steps, and future ideasSummaryIndex
评论:

