Skip to Main Content
Next.js Quick Start Guide
book

Next.js Quick Start Guide

by Kirill Konshin
July 2018
Intermediate to advanced content levelIntermediate to advanced
164 pages
3h 15m
English
Packt Publishing
Content preview from Next.js Quick Start Guide

Writing unit tests for Next.js apps

A unit test is a software testing method when modules and other granular parts of source code are tested independently in order to determine the correctness of their implementation. The key point of unit tests is that they should be small, cheap to run, and isolated. And there could be a ton of them to provide good coverage.

Writing unit tests for JavaScript nowadays is easier than ever before. With modern tools, the setup takes a few minutes and you can start getting the benefits right away. This includes coverage out of the box.

For this example, we will be using Jest and Enzyme – one of the most widespread frameworks for testing React apps. Jest provides a test runner and assertion engine, and Enzyme ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Create React App 2 Quick Start Guide

Create React App 2 Quick Start Guide

Brandon Richey
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781788993661Supplemental Content