Our Real Jasmine Project

One common problem in testing JavaScript is splitting the functionality and code into testable units. If you’re not working within the structure of a client framework, and are instead doing something more like the traditional bowl of jQuery spaghetti, you’ll need to adjust your coding to allow for testable units.

Prescription 35Use JavaScript testing to help design your JavaScript code to allow for modular items with few tangled interdependencies.

We’ll do this using an outside-in process similar to the one we’ve been using server-side, just with different boundaries. For JavaScript purposes we’ll be using integration tests to be black-box tests of the client interaction. In other words, the integration tests will assume ...

Get Rails 4 Test Prescriptions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.