beforeEach(fn): void
Attributes
fn:
Function | AsyncFunctionThe hook function. It receives an object with
the benchmark's
name, params, and signal.Registers a hook that runs once before each complete logical benchmark in the
current suite. It does not run before every sample. Per-sample setup belongs in
the benchmark function before context.start() or context.record().