( fn: AroundEachListener<ExtraContext>, timeout?: number, )
| 375 | * ``` |
| 376 | */ |
| 377 | export function aroundEach<ExtraContext = object>( |
| 378 | fn: AroundEachListener<ExtraContext>, |
| 379 | timeout?: number, |
| 380 | ): void { |
| 381 | assertTypes(fn, '"aroundEach" callback', ['function']) |
| 382 | const stackTraceError = new Error('STACK_TRACE_ERROR') |
| 383 | const resolvedTimeout = timeout ?? getDefaultHookTimeout() |
| 384 | |
| 385 | const wrapper: AroundEachListener<ExtraContext> = (runTest, context, suite) => { |
| 386 | const innerFn = (ctx: any) => fn(runTest, ctx, suite) |
| 387 | configureProps(innerFn, { index: 1, original: fn }) |
| 388 | |
| 389 | const fixtureResolver = withFixtures(innerFn, { suite }) |
| 390 | return fixtureResolver(context) |
| 391 | } |
| 392 | |
| 393 | return getCurrentSuite<ExtraContext>().on( |
| 394 | 'aroundEach', |
| 395 | Object.assign( |
| 396 | wrapper, |
| 397 | { |
| 398 | [AROUND_TIMEOUT_KEY]: resolvedTimeout, |
| 399 | [AROUND_STACK_TRACE_KEY]: stackTraceError, |
| 400 | }, |
| 401 | ), |
| 402 | ) |
| 403 | } |
| 404 | |
| 405 | function withSuiteFixtures( |
| 406 | suiteHook: WithFixturesOptions['suiteHook'], |
nothing calls this directly
no test coverage detected