* Gracefully cancel the current test run. Vitest will wait until all running tests are finished before cancelling.
(reason: CancelReason)
| 1170 | * Gracefully cancel the current test run. Vitest will wait until all running tests are finished before cancelling. |
| 1171 | */ |
| 1172 | async cancelCurrentRun(reason: CancelReason): Promise<void> { |
| 1173 | this.isCancelling = true |
| 1174 | this.cancelPromise = Promise.all([...this._onCancelListeners].map(listener => listener(reason))) |
| 1175 | |
| 1176 | await this.cancelPromise.finally(() => (this.cancelPromise = undefined)) |
| 1177 | await this.runningPromise |
| 1178 | } |
| 1179 | |
| 1180 | /** @internal */ |
| 1181 | async _initBrowserServers(): Promise<void> { |