O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required