Skip to content

Commit 2fb8ecd

Browse files
author
John Doe
committed
refactor: wip
1 parent 986ce0e commit 2fb8ecd

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,29 @@ describe('runAutorunExecutor', () => {
109109
it('should set env var information if verbose is set', async () => {
110110
const output = await runAutorunExecutor(
111111
{
112-
dryRun: true, // here to produce log
112+
verbose: true,
113+
},
114+
{ ...executorContext('github-action'), cwd: '<CWD>' },
115+
);
116+
117+
expect(executeProcessSpy).toHaveBeenCalledTimes(1);
118+
expect(executeProcessSpy).toHaveBeenCalledWith({
119+
command: 'npx',
120+
args: expect.arrayContaining(['@code-pushup/cli']),
121+
cwd: '<CWD>',
122+
env: expect.objectContaining({
123+
CP_VERBOSE: 'true',
124+
}),
125+
});
126+
127+
expect(output.command).not.toContain('--verbose');
128+
expect(loggerSpy.warn).toHaveBeenCalledTimes(0);
129+
});
130+
131+
it('should log env var in dryRun information if verbose is set', async () => {
132+
const output = await runAutorunExecutor(
133+
{
134+
dryRun: true,
113135
verbose: true,
114136
},
115137
{ ...executorContext('github-action'), cwd: '<CWD>' },

0 commit comments

Comments
 (0)