Skip to content

Commit

Permalink
refactor(nx-plugins): adjust outputDir
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Jul 12, 2024
1 parent e4a50af commit 2951228
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/nx-plugin/src/executors/internal/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ export function persistConfig(
options: Partial<PersistConfig & ProjectExecutorOnlyOptions>,
context: BaseNormalizedExecutorContext,
): Partial<PersistConfig> {
const { projectConfig } = context;
const { projectConfig, workspaceRoot } = context;

const { name: projectName = '', root: projectRoot = '' } =
projectConfig ?? {};
const { name: projectName = '' } = projectConfig ?? {};
const {
format,
outputDir = join(projectRoot, '.code-pushup', projectName), // always in <root>/.code-pushup/<project-name>,
outputDir = join(workspaceRoot, '.code-pushup', projectName), // always in <root>/.code-pushup/<project-name>,
filename,
} = options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ describe('persistConfig', () => {
);
expect(toNormalizedPath(outputDir)).toEqual(
expect.stringContaining(
toNormalizedPath(`packages/project-root/.code-pushup/${projectName}`),
toNormalizedPath(
`/test/root/workspace-root/.code-pushup/${projectName}`,
),
),
);
});
Expand Down

0 comments on commit 2951228

Please sign in to comment.