Skip to content

Commit fc411fa

Browse files
committed
refactor(nx-plugins): adjust outputDir
1 parent 0fda1da commit fc411fa

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/nx-plugin/src/executors/internal/config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ export function persistConfig(
2626
options: Partial<PersistConfig & ProjectExecutorOnlyOptions>,
2727
context: BaseNormalizedExecutorContext,
2828
): Partial<PersistConfig> {
29-
const { projectConfig } = context;
29+
const { projectConfig, workspaceRoot } = context;
3030

31-
const { name: projectName = '', root: projectRoot = '' } =
32-
projectConfig ?? {};
31+
const { name: projectName = '' } = projectConfig ?? {};
3332
const {
3433
format,
35-
outputDir = join(projectRoot, '.code-pushup', projectName), // always in <root>/.code-pushup/<project-name>,
34+
outputDir = join(workspaceRoot, '.code-pushup', projectName), // always in <root>/.code-pushup/<project-name>,
3635
filename,
3736
} = options;
3837

packages/nx-plugin/src/executors/internal/config.unit.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ describe('persistConfig', () => {
172172
);
173173
expect(toNormalizedPath(outputDir)).toEqual(
174174
expect.stringContaining(
175-
toNormalizedPath(`packages/project-root/.code-pushup/${projectName}`),
175+
toNormalizedPath(
176+
`/test/root/workspace-root/.code-pushup/${projectName}`,
177+
),
176178
),
177179
);
178180
});

0 commit comments

Comments
 (0)