mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-07 23:40:21 -05:00
fix: open browser at correct time during lifecycle (#19572)
This commit is contained in:
@@ -284,6 +284,13 @@ export class ProjectBase<TServer extends Server> extends EE {
|
||||
return
|
||||
}
|
||||
|
||||
__reset () {
|
||||
preprocessor.close()
|
||||
devServer.close()
|
||||
|
||||
process.chdir(localCwd)
|
||||
}
|
||||
|
||||
async close () {
|
||||
debug('closing project instance %s', this.projectRoot)
|
||||
|
||||
@@ -294,19 +301,16 @@ export class ProjectBase<TServer extends Server> extends EE {
|
||||
return
|
||||
}
|
||||
|
||||
const closePreprocessor = this.testingType === 'e2e' ? preprocessor.close : undefined
|
||||
this.__reset()
|
||||
|
||||
this.ctx.setAppServerPort(undefined)
|
||||
this.ctx.setAppSocketServer(undefined)
|
||||
|
||||
await Promise.all([
|
||||
this.server?.close(),
|
||||
closePreprocessor?.(),
|
||||
])
|
||||
|
||||
this._isServerOpen = false
|
||||
|
||||
process.chdir(localCwd)
|
||||
this.isOpen = false
|
||||
|
||||
const config = this.getConfig()
|
||||
|
||||
Reference in New Issue
Block a user