Skip to content

Commit 413ec5e

Browse files
authoredApr 17, 2024··
fix: close vite servers on all resolved projects (#5544)
1 parent 9e6417c commit 413ec5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎packages/vitest/src/node/core.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -868,10 +868,10 @@ export class Vitest {
868868
for await (const project of teardownProjects.reverse())
869869
await project.teardownGlobalSetup()
870870

871-
const closePromises: unknown[] = this.projects.map(w => w.close().then(() => w.server = undefined as any))
871+
const closePromises: unknown[] = this.resolvedProjects.map(w => w.close().then(() => w.server = undefined as any))
872872
// close the core workspace server only once
873873
// it's possible that it's not initialized at all because it's not running any tests
874-
if (!this.projects.includes(this.coreWorkspaceProject))
874+
if (!this.resolvedProjects.includes(this.coreWorkspaceProject))
875875
closePromises.push(this.coreWorkspaceProject.close().then(() => this.server = undefined as any))
876876

877877
if (this.pool) {
@@ -905,7 +905,7 @@ export class Vitest {
905905
this.state.getProcessTimeoutCauses().forEach(cause => console.warn(cause))
906906

907907
if (!this.pool) {
908-
const runningServers = [this.server, ...this.projects.map(p => p.server)].filter(Boolean).length
908+
const runningServers = [this.server, ...this.resolvedProjects.map(p => p.server)].filter(Boolean).length
909909

910910
if (runningServers === 1)
911911
console.warn('Tests closed successfully but something prevents Vite server from exiting')

0 commit comments

Comments
 (0)
Please sign in to comment.