Skip to main content

method Deno.DenoTest.beforeAll

#DenoTest.beforeAll(fn: () => void | Promise<void>): void

Register a function to be called before all tests in the current scope.

These functions are run in FIFO order (first in, first out).

If an exception is raised during execution of this hook, the remaining beforeAll hooks will not be run.

Deno.test.beforeAll(() => {
  // Setup code that runs once before all tests
  console.log("Setting up test suite");
});

Parameters #

#fn: () => void | Promise<void>

Return Type #

void

Did you find what you needed?

Privacy policy