Member-only story

Introduction To JavaScript Unit Testing: Jest and ES6 Part 1

Tom Smykowski
4 min readMar 1, 2024

--

You’d like to learn unit testing in JavaScript? Follow me new series about Jest unit testing!

Jest is a popular unit testing framework developed by Facebook / Meta. It’s a framework used for unit testing of JavaScript applications, both vanilla, but also using any available framework like Vue.js, React.js, Angular.js or other.

The goal behind Jest is to provide an efficient solution to unit test applications, while keeping great user experience and making the whole process easy.

Jest was released in 2014. It supports snapshot testing, mocking, parallel test execution. As of writing the latest version of Jest is 29.7.0.

To install it, you have to have Node.js already installed. After that you can execute this command (or equivalent for your package manager):

pnpm add — save-dev jest

I like to use pnpm because it’s faster than npm and yarn. But you can use what you like. Jest will install on your laptop:

--

--

Tom Smykowski
Tom Smykowski

Written by Tom Smykowski

🚀 Senior/Lead Frontend Engineer | Angular · Vue.js · React | Design Systems, UI/UX | Looking for a new project! 📩 contact@tomasz-smykowski.com

Responses (2)