Better Programming

Advice for programmers.

Follow publication

Member-only story

How to Use Chrome DevTools to Debug Unit Test Cases

Better debugging with Chrome DevTools

Jennifer Fu
Better Programming
Published in
7 min readMar 25, 2020

--

Photo by Robynne Hu on Unsplash

How do you debug unit test cases? There are two popular methods:

In this article, we’re going to cover the second method: Using Chrome DevTools to debug unit test cases.

What is Node.js? It’s an open-source and cross-platform JavaScript runtime environment. It can be interchangeably called NodeJS, nodejs, or node. It is a popular tool for Web development. Node.js runs the V8 JavaScript engine, the core of Google Chrome, outside the browser. This allows us to use Node.js and Chrome DevTools to debug unit test cases.

Debug the Original Create React App Unit Test Cases

Let’s use Facebook’s famous Create React App as an example. There’s one unit test file, src/App.test.js, in the codebase:

--

--

No responses yet

Write a response