Skip to content

Commit

Permalink
Close servers on this.resolvedProjects instead of this.projects
Browse files Browse the repository at this point in the history
  • Loading branch information
surc54 committed Apr 15, 2024
1 parent c84113f commit 65452aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,10 @@ export class Vitest {
for await (const project of teardownProjects.reverse())
await project.teardownGlobalSetup()

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

if (this.pool) {
Expand Down

0 comments on commit 65452aa

Please sign in to comment.