(runner: VitestRunner, userFixtures: UserFixtures)
| 84 | } |
| 85 | |
| 86 | override(runner: VitestRunner, userFixtures: UserFixtures): void { |
| 87 | const { suite: currentSuite, file } = getCurrentSuite() |
| 88 | const suite = currentSuite || file |
| 89 | const isTopLevel = !currentSuite || currentSuite.file === currentSuite |
| 90 | // Create a copy of the closest parent's registrations to avoid modifying them |
| 91 | // For chained calls, this.get(suite) returns this suite's overrides; for first call, returns parent's |
| 92 | const suiteRegistrations = new Map(this.get(suite)) |
| 93 | const registrations = this.parseUserFixtures(runner, userFixtures, isTopLevel, suiteRegistrations) |
| 94 | // If defined in top-level, just override all registrations |
| 95 | // We don't support overriding suite-level fixtures anyway (it will throw an error) |
| 96 | if (isTopLevel) { |
| 97 | this._registrations = registrations |
| 98 | } |
| 99 | else { |
| 100 | this._overrides.set(suite, registrations) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | getFileContext(file: File): Record<string, any> { |
| 105 | if (!this._suiteContexts.has(file)) { |
no test coverage detected