In Chapter 7, TypeScript Compatible Frameworks, we discussed TypeScript compatible frameworks, and explored how Backbone, Aurelia, Angular, and React use the MVC or the MV* design patterns to write models, views, and controllers. We implemented the same sample application in each of these frameworks, in order to be able to compare the similarities between them, and note the subtle differences. Then, in our last chapter, we started exploring test-driven development, and discussed the use of Jasmine as a test framework. We also explored using various test runners, including Testem and Karma, and finally explored Protractor for running integration, or end-to-end, tests.
In this chapter, we will essentially be combining our work from the previous two chapters, and will be discussing how to unit and integration test each of our TypeScript compatible frameworks. For each of these frameworks, then, we will cover the following topics:
- The setup of a unit-testing framework
- Writing basic unit tests
- Checking the DOM for rendered elements
- Checking initial form values
- Modifying form values
- Submitting forms