Design Client-Side Code
JavaScript that runs within browsers poses some additional challenges. Youâll want to check that the code
- Works well in all target browsers
- Interacts properly with the server
- Correctly acts on user commands
Thatâs a lot of stuff to take care of and we have the rest of the book to walk through these concerns. Right now, weâll take the first step toward that goalâusing a small example, youâll learn how to load code into a browser and run multiple automated tests.
Weâve already implemented the isPalindrome function, with tests, to run on the server side within Node.js. Weâre all set to implement the same function for the client side to run within a browser.
Open the file tdd/client/palindrome/test/palindrome-test.js ...
Get Test-Driving JavaScript Applications 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.