From 4298d79c823ee8bf69383baef9e28336a78d7577 Mon Sep 17 00:00:00 2001 From: AriPerkkio Date: Wed, 20 Dec 2023 19:39:41 +0200 Subject: [PATCH] fix(watch): cancelled tests are shown twice in reporter --- packages/vitest/src/node/pools/browser.ts | 2 +- packages/vitest/src/node/pools/child.ts | 2 +- packages/vitest/src/node/pools/threads.ts | 2 +- packages/vitest/src/node/pools/vm-threads.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vitest/src/node/pools/browser.ts b/packages/vitest/src/node/pools/browser.ts index e26fe75b3f7b..fdbaa08f8af4 100644 --- a/packages/vitest/src/node/pools/browser.ts +++ b/packages/vitest/src/node/pools/browser.ts @@ -44,7 +44,7 @@ export function createBrowserPool(ctx: Vitest): ProcessPool { if (project.config.browser.isolate) { for (const path of paths) { if (isCancelled) { - ctx.state.cancelFiles(files.slice(paths.indexOf(path)), ctx.config.root, project.getName()) + ctx.state.cancelFiles(files.slice(paths.indexOf(path)), ctx.config.root, project.config.name) break } diff --git a/packages/vitest/src/node/pools/child.ts b/packages/vitest/src/node/pools/child.ts index 513d3ad7a309..6392744c6aed 100644 --- a/packages/vitest/src/node/pools/child.ts +++ b/packages/vitest/src/node/pools/child.ts @@ -118,7 +118,7 @@ export function createChildProcessPool(ctx: Vitest, { execArgv, env, forksPath } // Intentionally cancelled else if (ctx.isCancelling && error instanceof Error && /The task has been cancelled/.test(error.message)) - ctx.state.cancelFiles(files, ctx.config.root, project.getName()) + ctx.state.cancelFiles(files, ctx.config.root, project.config.name) else throw error diff --git a/packages/vitest/src/node/pools/threads.ts b/packages/vitest/src/node/pools/threads.ts index c426cc6074c1..3dfa6402baa0 100644 --- a/packages/vitest/src/node/pools/threads.ts +++ b/packages/vitest/src/node/pools/threads.ts @@ -106,7 +106,7 @@ export function createThreadsPool(ctx: Vitest, { execArgv, env, workerPath }: Po // Intentionally cancelled else if (ctx.isCancelling && error instanceof Error && /The task has been cancelled/.test(error.message)) - ctx.state.cancelFiles(files, ctx.config.root, project.getName()) + ctx.state.cancelFiles(files, ctx.config.root, project.config.name) else throw error diff --git a/packages/vitest/src/node/pools/vm-threads.ts b/packages/vitest/src/node/pools/vm-threads.ts index 9adf22c0b775..b48fc60ad957 100644 --- a/packages/vitest/src/node/pools/vm-threads.ts +++ b/packages/vitest/src/node/pools/vm-threads.ts @@ -111,7 +111,7 @@ export function createVmThreadsPool(ctx: Vitest, { execArgv, env, vmPath }: Pool // Intentionally cancelled else if (ctx.isCancelling && error instanceof Error && /The task has been cancelled/.test(error.message)) - ctx.state.cancelFiles(files, ctx.config.root, project.getName()) + ctx.state.cancelFiles(files, ctx.config.root, project.config.name) else throw error