function
test.beforeAll
fn: () => void | Promise<unknown> | (done: (err?: unknown) => void) => void,
options?: HookOptions
): void;
Runs a function, once, before all the tests.
Use this for setup, like initializing a global variable or connecting to a database.
If the function throws, no tests in the file run.
@param fn
the function to run
let database;
beforeAll(async () => {
database = await connect("localhost");
});