diff --git a/e2e/nx-run/src/run.test.ts b/e2e/nx-run/src/run.test.ts index 88b7cc4018..3e4ff90865 100644 --- a/e2e/nx-run/src/run.test.ts +++ b/e2e/nx-run/src/run.test.ts @@ -512,7 +512,8 @@ describe('Nx Running Tests', () => { runCLI(`generate @nrwl/web:app ${myapp2}`); let outputs = runCLI( - `run-many -t build test -p ${myapp1} ${myapp2} --ci` + // Options with lists can be specified using multiple args or with a delimiter (comma or space). + `run-many -t build -t test -p ${myapp1} ${myapp2} --ci` ); expect(outputs).toContain('Running targets build, test for 2 projects:'); diff --git a/packages/nx/src/command-line/nx-commands.ts b/packages/nx/src/command-line/nx-commands.ts index 3016c7b6ad..f31e6410d3 100644 --- a/packages/nx/src/command-line/nx-commands.ts +++ b/packages/nx/src/command-line/nx-commands.ts @@ -1017,10 +1017,13 @@ function withWatchOptions(yargs: yargs.Argv) { }, true); } -function parseCSV(args: string) { +function parseCSV(args: string[] | string) { if (!args) { return args; } + if (Array.isArray(args)) { + return args; + } return args.split(','); }