fix: open browser at correct time during lifecycle (#19572)

This commit is contained in:
Tim Griesser
2022-01-12 13:41:25 -05:00
committed by GitHub
parent 139d88d91f
commit bfc032a2d4
32 changed files with 285 additions and 289 deletions
+8 -4
View File
@@ -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()