@@ -12,7 +12,7 @@ import { noop, slash, toArray } from '@vitest/utils'
12
12
import { getTasks , hasFailed } from '@vitest/runner/utils'
13
13
import { version } from '../../package.json' with { type : 'json' }
14
14
import { getCoverageProvider } from '../integrations/coverage'
15
- import { workspacesFiles as workspaceFiles } from '../constants'
15
+ import { defaultBrowserPort , workspacesFiles as workspaceFiles } from '../constants'
16
16
import { WebSocketReporter } from '../api/setup'
17
17
import type { SerializedCoverageConfig } from '../runtime/config'
18
18
import type { ArgumentsType , OnServerRestartHandler , ProvidedContext , UserConsoleLog } from '../types/general'
@@ -87,6 +87,9 @@ export class Vitest {
87
87
/** @deprecated use `_cachedSpecs` */
88
88
projectTestFiles = this . _cachedSpecs
89
89
90
+ /** @private */
91
+ public _browserLastPort = defaultBrowserPort
92
+
90
93
constructor (
91
94
public readonly mode : VitestRunMode ,
92
95
options : VitestOptions = { } ,
@@ -104,6 +107,7 @@ export class Vitest {
104
107
this . unregisterWatcher ?.( )
105
108
clearTimeout ( this . _rerunTimer )
106
109
this . restartsCount += 1
110
+ this . _browserLastPort = defaultBrowserPort
107
111
this . pool ?. close ?.( )
108
112
this . pool = undefined
109
113
this . coverageProvider = undefined
0 commit comments