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 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.