(includeLocation: boolean)
| 489 | } |
| 490 | |
| 491 | function initSuite(includeLocation: boolean) { |
| 492 | if (typeof suiteOptions === 'number') { |
| 493 | suiteOptions = { timeout: suiteOptions } |
| 494 | } |
| 495 | |
| 496 | const currentSuite = collectorContext.currentSuite?.suite |
| 497 | const parentTask = currentSuite ?? collectorContext.currentSuite?.file |
| 498 | const suiteTags = toArray(suiteOptions?.tags) |
| 499 | validateTags(runner.config, suiteTags) |
| 500 | |
| 501 | suite = { |
| 502 | id: '', |
| 503 | type: 'suite', |
| 504 | name, |
| 505 | fullName: createTaskName([ |
| 506 | currentSuite?.fullName ?? collectorContext.currentSuite?.file?.fullName, |
| 507 | name, |
| 508 | ]), |
| 509 | fullTestName: createTaskName([currentSuite?.fullTestName, name]), |
| 510 | suite: currentSuite, |
| 511 | mode, |
| 512 | each, |
| 513 | file: (currentSuite?.file ?? collectorContext.currentSuite?.file)!, |
| 514 | shuffle: suiteOptions?.shuffle, |
| 515 | tasks: [], |
| 516 | meta: suiteOptions?.meta ?? Object.create(null), |
| 517 | concurrent: suiteOptions?.concurrent, |
| 518 | tags: unique([...parentTask?.tags || [], ...suiteTags]), |
| 519 | } |
| 520 | |
| 521 | if (runner && includeLocation && runner.config.includeTaskLocation) { |
| 522 | const limit = Error.stackTraceLimit |
| 523 | Error.stackTraceLimit = 15 |
| 524 | const error = new Error('stacktrace').stack! |
| 525 | Error.stackTraceLimit = limit |
| 526 | const stack = findTestFileStackTrace(currentTestFilepath, error) |
| 527 | if (stack) { |
| 528 | suite.location = { |
| 529 | line: stack.line, |
| 530 | column: stack.column, |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | setHooks(suite, createSuiteHooks()) |
| 536 | } |
| 537 | |
| 538 | function clear() { |
| 539 | tasks.length = 0 |
no test coverage detected