Blog55.9K views2,797 votes0 replies1,103 following
Managing Test State with Mocha Hooks: Avoiding the Pollution Trap
Mocha hooks extract repeated setup and teardown, but choosing before versus beforeEach determines whether tests stay isolated or pollute each other.