@@ -36,16 +36,11 @@ describe("[aggregated-output] npm-run-all", () => {
3636 }
3737
3838 describe ( "should not intermingle output of various commands" , ( ) => {
39- const EXPECTED_SERIALIZED_TEXT = [
40- createExpectedOutput ( "first" ) ,
41- createExpectedOutput ( "second" ) ,
42- `${ createExpectedOutput ( "third" ) } \n` ,
43- ] . join ( "\n" )
44-
4539 const EXPECTED_PARALLELIZED_TEXT = [
4640 createExpectedOutput ( "second" ) ,
4741 createExpectedOutput ( "third" ) ,
48- `${ createExpectedOutput ( "first" ) } \n` ,
42+ createExpectedOutput ( "first" ) ,
43+ "" ,
4944 ] . join ( "\n" )
5045
5146 let stdout = null
@@ -54,28 +49,59 @@ describe("[aggregated-output] npm-run-all", () => {
5449 stdout = new BufferStream ( )
5550 } )
5651
57- it ( "Node API" , async ( ) => {
52+ it ( "Node API with parallel " , async ( ) => {
5853 await nodeApi (
5954 [ "test-task:delayed first 300" , "test-task:delayed second 100" , "test-task:delayed third 200" ] ,
60- { stdout, silent : true , aggregateOutput : true }
55+ { stdout, parallel : true , silent : true , aggregateOutput : true }
6156 )
62- assert . equal ( stdout . value , EXPECTED_SERIALIZED_TEXT )
57+ assert . equal ( stdout . value , EXPECTED_PARALLELIZED_TEXT )
6358 } )
6459
65- it ( "npm-run-all command" , async ( ) => {
60+ it ( "Node API without parallel should fail" , async ( ) => {
61+ try {
62+ await nodeApi (
63+ [ "test-task:delayed first 300" , "test-task:delayed second 100" , "test-task:delayed third 200" ] ,
64+ { stdout, silent : true , aggregateOutput : true }
65+ )
66+ }
67+ catch ( _err ) {
68+ return
69+ }
70+ assert ( false , "should fail" )
71+ } )
72+
73+ it ( "npm-run-all command with parallel" , async ( ) => {
6674 await runAll (
67- [ "test-task:delayed first 300" , "test-task:delayed second 100" , "test-task:delayed third 200" , "--silent" , "--aggregate-output" ] ,
75+ [ "--parallel" , " test-task:delayed first 300", "test-task:delayed second 100" , "test-task:delayed third 200" , "--silent" , "--aggregate-output" ] ,
6876 stdout
6977 )
70- assert . equal ( stdout . value , EXPECTED_SERIALIZED_TEXT )
78+ assert . equal ( stdout . value , EXPECTED_PARALLELIZED_TEXT )
7179 } )
7280
73- it ( "run-s command" , async ( ) => {
74- await runSeq (
75- [ "test-task:delayed first 300" , "test-task:delayed second 100" , "test-task:delayed third 200" , "--silent" , "--aggregate-output" ] ,
76- stdout
77- )
78- assert . equal ( stdout . value , EXPECTED_SERIALIZED_TEXT )
81+ it ( "npm-run-all command without parallel should fail" , async ( ) => {
82+ try {
83+ await runAll (
84+ [ "test-task:delayed first 300" , "test-task:delayed second 100" , "test-task:delayed third 200" , "--silent" , "--aggregate-output" ] ,
85+ stdout
86+ )
87+ }
88+ catch ( _err ) {
89+ return
90+ }
91+ assert ( false , "should fail" )
92+ } )
93+
94+ it ( "run-s command should fail" , async ( ) => {
95+ try {
96+ await runSeq (
97+ [ "test-task:delayed first 300" , "test-task:delayed second 100" , "test-task:delayed third 200" , "--silent" , "--aggregate-output" ] ,
98+ stdout
99+ )
100+ }
101+ catch ( _err ) {
102+ return
103+ }
104+ assert ( false , "should fail" )
79105 } )
80106
81107 it ( "run-p command" , async ( ) => {
0 commit comments