Skip to content

Commit 1d006f2

Browse files
committed
refactor: fix e2e
1 parent aa0950a commit 1d006f2

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,10 @@ describe('nx-plugin', () => {
173173
});
174174

175175
const cleanStdout = removeColorCodes(stdout);
176-
// @TODO create test environment for working plugin. This here misses package-lock.json to execute correctly
177-
expect(cleanStdout).toContain('Executing command:');
178-
expect(cleanStdout).toContain('npx @code-pushup/cli');
179-
expect(cleanStdout).toContain(
180-
'NX Successfully ran target code-pushup for project my-lib',
181-
);
176+
expect(cleanStdout).toContain('nx run my-lib:code-pushup');
177+
expect(cleanStdout).toContain('$ npx @code-pushup/cli ');
178+
expect(cleanStdout).toContain('--dryRun --verbose');
179+
expect(cleanStdout).toContain(`--upload.project=\\"${project}\\"`);
182180
});
183181

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

packages/nx-plugin/src/executors/cli/executor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type { AutorunCommandExecutorOptions } from './schema.js';
99
import { mergeExecutorOptions, parseAutorunExecutorOptions } from './utils.js';
1010

1111
export function stringifyError(error: unknown): string {
12-
// TODO: special handling for ZodError instances
1312
if (error instanceof Error) {
1413
if (error.name === 'Error' || error.message.startsWith(error.name)) {
1514
return error.message;
@@ -58,6 +57,7 @@ export default async function runAutorunExecutor(
5857
...(context.cwd ? { cwd: context.cwd } : {}),
5958
env,
6059
dryRun,
60+
verbose,
6161
});
6262
} catch (error) {
6363
logger.error(error);

packages/nx-plugin/src/internal/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ansis from 'ansis';
2-
import path from 'node:path';
2+
import * as path from 'node:path';
33

44
type ArgumentValue = number | string | boolean | string[] | undefined;
55
export type CliArgsObject<T extends object = Record<string, ArgumentValue>> =

testing/test-nx-utils/src/lib/utils/nx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function nxShowProjectJson<T extends ProjectConfiguration>(
8484
) {
8585
const { code, stderr, stdout } = await executeProcess({
8686
command: 'npx',
87-
args: ['nx', 'show', `project ${project} --json`],
87+
args: ['nx', 'show', 'project', '--json', project],
8888
cwd,
8989
});
9090

0 commit comments

Comments
 (0)