beforeEach

View Source

Summary

Registers a hook that runs before each test in the current suite (or globally if called outside a describe). Multiple calls are chained in registration order.

Signature

function beforeEach(fn: () => void | Promise<void>): void;

Params

fn

The setup function to run before each test.