Let’s Get Started

You should get comfortable writing and running tests before we dive into designing with tests. That’s what we’ll do first: get a project set up and get a few tests running.

We’ll use a very simple function that converts Fahrenheit to Celsius as a vehicle to learn about the test writing fundamentals. As a first step we’ll check the installation of Node.js and npm on your system. Then we’ll get an example project set up and install the tools necessary for writing the tests. Next, we’ll warm up and confirm that everything got installed by writing an introductory test. Along the way you’ll learn about test suites and the organization of test and source code files. Finally, we’ll write a test to verify the behavior ...

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.