Test hooks are functions run automatically before or after tests: beforeEach, afterEach, before, after. They prepare and clean up the environment so each test starts from a known state and stays independent of the others.
Example
beforeEach(() => { db.reset(); });