Skip to content

Glossary: Building APIs with Node.js

beforeEach, afterEach

Also written: beforeEach, afterEach

`node:test` hooks that run before and after every test in a file. They are typically used to build a fresh app (and database) before each test and close it afterward, so tests can't affect each other.

Where the book teaches it

Related terms

node:test:memory: database