TDD in Javascript
Explore how to apply test-driven development principles to JavaScript by writing and running Jasmine unit tests. Understand isolating logic from the DOM and server, and learn to build client-side features with minimal dependencies for more robust applications.
TDD unit testing JavaScript example
Now let’s try to build the task-rearrangement feature in JavaScript using TDD. We’ll use a different approach to JavaScript than we did in the previous chapter, and we’ll be completely rewriting the JavaScript Task class. First, we’ll build the logic without regard to how the application will get data into the JavaScript objects and how they will interact with the DOM. Approaching the feature this way allows us to focus on the code and not the large external dependencies of the server-side data and the DOM.
We still have the Capybara integration test from ...