Docs (4.0.0)
class TestScope method

beforeEach

Adds a callback that’s called before each test in this scope, and nested scopes.

beforeEach(f: (test: TestCase) => void | Promise<void>): void

Parameters

  • f — The function to be called before each test. The TestCase instance for each test is passed as the only argument.

Related

  • class TestScopeA class that represents a test scope, containing a number of test cases.