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, }; }