interface
test.ExtendTest
interface ExtendTest<Context>
The type of test.extend.
Referenced types
type Fixtures<Added, Context = object> = { [K in keyof Added]: Fixture<Added[Name], Omit<Added, Name> & Context & TestContext> | [Fixture<Added[Name], Omit<Added, Name> & Context & TestContext>, FixtureOptions] }
interface TestWithContext<Context, Row extends ReadonlyArray<unknown> = []>
A test whose callbacks receive the TestContext instead of a done callback.
- aroundAll: AroundHook<Context>
Like aroundAll. The callback receives the
scope: "file"or"worker"fixtures that it destructures. - aroundEach: AroundHook<Context & TestContext>
Like aroundEach. A fixture the callback destructures is torn down after the callback finishes.
- beforeAll: SuiteHook<Context>
The callback receives the
scope: "file"or"worker"fixtures that it destructures, and the suite. - beforeEach: ContextHook<Context>
If the callback returns a function, that function runs after the
afterEachhooks.
interface FixtureOptions
- scope?: 'file' | 'worker' | 'test'
With
"file"or"worker", the fixture is set up once, for the first test that needs it, and torn down after the file's last test.