diff --git a/packages/nx/src/executors/run-commands/run-commands.impl.spec.ts b/packages/nx/src/executors/run-commands/run-commands.impl.spec.ts index 3fcb9ab64dce7c..1dae058bc710b6 100644 --- a/packages/nx/src/executors/run-commands/run-commands.impl.spec.ts +++ b/packages/nx/src/executors/run-commands/run-commands.impl.spec.ts @@ -88,6 +88,42 @@ describe('Run Commands', () => { expect(readFile(f)).toEqual('12'); }); + it('should run the command, but divided into paths', async () => { + const f = fileSync().name; + const result = await runCommands( + { + command: [`echo 1 >> ${f}`, '&&', `echo 2 >> ${f}`], + parallel: false, + + __unparsed__: [], + }, + context + ); + expect(result).toEqual(expect.objectContaining({ success: true })); + expect(readFile(f)).toEqual('12'); + }); + + it('should run the command, but divided into several paths', async () => { + const f = fileSync().name; + const result = await runCommands( + { + command: [ + `echo 1 >> ${f} `, + `&&`, + `echo 2 >> ${f}`, + ';', + `echo 34 >> ${f}`, + ], + parallel: false, + + __unparsed__: [], + }, + context + ); + expect(result).toEqual(expect.objectContaining({ success: true })); + expect(readFile(f)).toEqual('1234'); + }); + it('should run commands in parallel', async () => { const f = fileSync().name; const result = await runCommands(