Search

Testing in Node — a New Skill-Pack on The Frontier

Sam Landfried

3 min read

Feb 11, 2019

Testing in Node — a New Skill-Pack on The Frontier

You Should Have a Test Suite

Software tests improve confidence in an application’s behavior, make it easier to grow and maintain, help identify breaking bugs and can even serve as a form of documentation. For a developer practicing TDD, writing tests is even an essential step before writing any application code.

The problems tests mitigate are expensive to resolve, so really they help organizations as much as developers.

Of course, tests don’t write themselves, and there is a cost associated with creating a comprehensive test suite for an application. One of the hurdles to creating a useful test suite is building the infrastructure required to write and run tests. Applications are complicated beasts, and useful tests need to handle that complexity.

Inspiration

Recently, I created a test suite for a client’s Node.js project. I love working in Node.js because it’s an un-opinionated framework that grants a lot of freedom to developers to tap into the huge ecosystem of JavaScript packages. That huge ecosystem extends to testing tools as well, so even for someone that has done a lot of JavaScript testing, setting up a test suite for the first time, or adding new tools to an existing test suite, can be a significant undertaking. I wanted to share the testing tools I use on Node projects, and demonstrate how to configure them to build a test suite that is scalable and provides meaningful feedback about an application. Testing in Node is a Skill Pack on The Frontier I created to do that.

Note that even though the series focuses on adding test coverage to a Node app, most of the tools and strategies can be used for any JavaScript app.

The Series

Over the course of the series, we’ll be adding test coverage to a full-stack messaging app called ChattrBox. You may be familiar with this app from the Big Nerd Ranch Front-End Web Development Book or our Full-Stack and React Essentials Bootcamp. It’s a modern, full-stack web app that has a Node backend running web sockets and a REST API to power the frontend’s chat interface. If you’re learning web development, I encourage you to follow along with the book and build the app yourself. However, if you just want to learn how to use some JavaScript testing tools, you’ll be able to download the application code from the Frontier and focus on the screencast material.

The series doesn’t cover testing philosophy or offer any opinions on what is or is not a good test, but it will show you how to add and configure a set of tools that will enable writing thorough tests to support an application. If you’re looking for thoughts on how to write good tests once you’ve got the tools set up, take a look at some of the testing blog posts by other Nerds.

Summary

If you’re new to testing in JavaScript and Node, this is a great series for you. If you have an existing app and test suite that you want to expand, you should be able to cherry pick some screencasts from the series that provide valuable direction for your unique situation.

The series describes my approach to Node or JavaScript testing, and there are plenty of other valid approaches. If you prefer another tool or strategy, tell us about it in the comments. Also, feel free to ask questions in the comments section. We’ll get someone to help you out.

The series starts with the ‘Basics’ video, so I’ll see you over there when you’re ready to get started.

Juan Pablo Claude

Reviewer Big Nerd Ranch

During his tenure at BNR, Juan Pablo has taught bootcamps on macOS development, iOS development, Python, and Django. He has also participated in consulting projects in those areas. Juan Pablo is currently a Director of Technology focusing mainly on managing engineers and his interests include Machine Learning and Data Science.

Speak with a Nerd

Schedule a call today! Our team of Nerds are ready to help

Let's Talk

Related Posts

We are ready to discuss your needs.

Not applicable? Click here to schedule a call.

Stay in Touch WITH Big Nerd Ranch News