From b4ac294539ca437c5df2a098c8fa0f8afef2e506 Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Mon, 21 Aug 2023 15:05:18 -0400 Subject: [PATCH] fix(testing): fix outputs for vitest generator (#18709) (cherry picked from commit 7900d56ff249b4addd643b3a6b55839932891121) --- packages/vite/src/generators/vitest/vitest.spec.ts | 2 +- packages/vite/src/utils/generator-utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/generators/vitest/vitest.spec.ts b/packages/vite/src/generators/vitest/vitest.spec.ts index 595dc1755dd5b..8bb3ca9474028 100644 --- a/packages/vite/src/generators/vitest/vitest.spec.ts +++ b/packages/vite/src/generators/vitest/vitest.spec.ts @@ -59,7 +59,7 @@ describe('vitest generator', () => { "reportsDirectory": "../../coverage/apps/my-test-react-app", }, "outputs": [ - "coverage/apps/my-test-react-app", + "{options.reportsDirectory}", ], } `); diff --git a/packages/vite/src/utils/generator-utils.ts b/packages/vite/src/utils/generator-utils.ts index a20caeeb66f20..c89d04e6fff05 100644 --- a/packages/vite/src/utils/generator-utils.ts +++ b/packages/vite/src/utils/generator-utils.ts @@ -191,7 +191,7 @@ export function addOrChangeTestTarget( } else { project.targets[target] = { executor: '@nx/vite:test', - outputs: [coveragePath], + outputs: ['{options.reportsDirectory}'], options: testOptions, }; }