Skip to content

Commit 2b2400c

Browse files
author
John Doe
committed
refactor: fix upload params
1 parent 734b4a4 commit 2b2400c

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,12 @@ describe('nx-plugin', () => {
196196
});
197197

198198
const cleanStdout = removeColorCodes(stdout);
199+
// Nx command
199200
expect(cleanStdout).toContain('nx run my-lib:code-pushup');
200-
expect(cleanStdout).toContain('npx @code-pushup/cli');
201+
// Run CLI executor
202+
expect(cleanStdout).toContain('Command: npx @code-pushup/cli');
201203
expect(cleanStdout).toContain('--dryRun --verbose');
202-
expect(cleanStdout).toBe(`--upload.project="${project}"`);
204+
expect(cleanStdout).toContain(`--upload.project="${project}"`);
203205
});
204206

205207
it('should consider plugin option bin in executor target', async () => {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ export function uploadConfig(
4646
options: Partial<UploadConfig & ProjectExecutorOnlyOptions>,
4747
context: BaseNormalizedExecutorContext,
4848
): Partial<UploadConfig> {
49-
const { projectConfig, workspaceRoot } = context;
49+
const { workspaceRoot, projectName } = context;
5050

51-
const { name: projectName } = projectConfig ?? {};
5251
const { projectPrefix, server, apiKey, organization, project, timeout } =
5352
options;
5453
const applyPrefix = workspaceRoot === '.';

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ export type CollectExecutorOnlyOptions = {
4848
*/
4949
export type BaseNormalizedExecutorContext = {
5050
projectConfig?: ProjectConfiguration;
51+
projectName?: string;
5152
} & { workspaceRoot: string };

0 commit comments

Comments
 (0)