( suiteHook: WithFixturesOptions['suiteHook'], fn: Function, context: InternalChainableContext | undefined, stackTraceError: Error, contextIndex = 0, )
| 403 | } |
| 404 | |
| 405 | function withSuiteFixtures( |
| 406 | suiteHook: WithFixturesOptions['suiteHook'], |
| 407 | fn: Function, |
| 408 | context: InternalChainableContext | undefined, |
| 409 | stackTraceError: Error, |
| 410 | contextIndex = 0, |
| 411 | ) { |
| 412 | return (...args: any[]) => { |
| 413 | const suite = args.at(-1) as Suite | File |
| 414 | const prefix = args.slice(0, -1) // this is potential "runSuite" |
| 415 | |
| 416 | const wrapper = (ctx: any) => fn(...prefix, ctx, suite) |
| 417 | configureProps(wrapper, { index: contextIndex, original: fn }) |
| 418 | |
| 419 | const fixtures = context?.getFixtures() |
| 420 | const fileContext = fixtures?.getFileContext(suite.file) |
| 421 | |
| 422 | const fixtured = withFixtures(wrapper, { |
| 423 | suiteHook, |
| 424 | fixtures, |
| 425 | context: fileContext, |
| 426 | stackTraceError, |
| 427 | }) |
| 428 | return fixtured() |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | export function getAroundHookTimeout(hook: Function): number { |
| 433 | return AROUND_TIMEOUT_KEY in hook && typeof hook[AROUND_TIMEOUT_KEY] === 'number' |
no test coverage detected