diff --git a/packages/plugin/src/utils/testing-utils/commands.ts b/packages/plugin/src/utils/testing-utils/commands.ts index 1cbbee3b9755a..946b516f70734 100644 --- a/packages/plugin/src/utils/testing-utils/commands.ts +++ b/packages/plugin/src/utils/testing-utils/commands.ts @@ -18,7 +18,7 @@ export function runNxCommand( ): string { function _runNxCommand(c) { const execSyncOptions: ExecOptions = { - cwd: opts.cwd, + cwd: opts.cwd ?? tmpProjPath(), env: { ...process.env, ...opts.env }, }; if (fileExists(tmpProjPath('package.json'))) {