function

test.aroundAll

function aroundAll(
fn: (runSuite: () => Promise<void>, context: object, suite: TestSuite) => unknown,
options?: HookOptions
): void;

Wraps all the tests of the file or describe() block in a function. The function does its setup, awaits runSuite(), then does its teardown.

runSuite() runs the block's beforeAll hooks, its tests and nested blocks, and its afterAll hooks, in the async context runSuite() is called in. If the hook fails before it calls runSuite(), none of them run.

Nesting, failures and the timeout work as in aroundEach. The hook doesn't run if every test in the block is skipped.

@param fn

the function to run around the tests

@param options

the timeout in milliseconds. 0 means no timeout

aroundAll(async runSuite => {
  await tracer.trace("suite", runSuite);
});