Testing Errors, with a Fresh Start for Every Test

An API's error answers, such as 400, 404 and 409 with their JSON bodies, are part of what it promises, so they get tests too, and beforeEach puts the in-memory data back before every test, so each one starts from the same seats.

By

Updated

Cheat sheet: Testing Errors, with a Fresh Start for Every Test
Category
Node.js
Level
Journeyman
Tags
400 Bad Request, 409 Conflict, Flaky Test, nodejs, Setup and Teardown, Test Isolation, unit testing