From 28d12c61ab0c589fb7745fa08675e5201aace85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Prokop?= Date: Mon, 9 Dec 2024 13:37:53 +0100 Subject: [PATCH] fix(vite): do not stop the test process of failure in watch mode --- packages/vite/src/executors/test/vitest.impl.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/executors/test/vitest.impl.ts b/packages/vite/src/executors/test/vitest.impl.ts index 898e49a52bdeb..302c23a609cb9 100644 --- a/packages/vite/src/executors/test/vitest.impl.ts +++ b/packages/vite/src/executors/test/vitest.impl.ts @@ -58,7 +58,10 @@ export async function* vitestExecutor( } // vitest sets the exitCode in case of exception without notifying reporters - if (process.exitCode === undefined) { + if ( + process.exitCode === undefined || + (watch && ctx.state.getFiles().length > 0) + ) { for await (const report of nxReporter) { // vitest sets the exitCode = 1 when code coverage isn't met hasErrors =