@@ -50,8 +50,8 @@ it('fails if no commands were provided', () => {
5050it ( 'spawns all commands' , ( ) => {
5151 create ( [ 'echo' , 'kill' ] ) ;
5252 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
53- expect ( spawn ) . toHaveBeenCalledWith ( 'echo' , expect . objectContaining ( { } ) ) ;
54- expect ( spawn ) . toHaveBeenCalledWith ( 'kill' , expect . objectContaining ( { } ) ) ;
53+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo' , expect . objectContaining ( { } ) ) ;
54+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'kill' , expect . objectContaining ( { } ) ) ;
5555} ) ;
5656
5757it ( 'log output is passed to output stream if logger is specified in options' , ( ) => {
@@ -61,8 +61,8 @@ it('log output is passed to output stream if logger is specified in options', ()
6161 logger . log ( 'foo' , 'bar' ) ;
6262
6363 expect ( outputStream . write ) . toHaveBeenCalledTimes ( 2 ) ;
64- expect ( outputStream . write ) . toHaveBeenCalledWith ( 'foo' ) ;
65- expect ( outputStream . write ) . toHaveBeenCalledWith ( 'bar' ) ;
64+ expect ( outputStream . write ) . toHaveBeenCalledExactlyOnceWith ( 'foo' ) ;
65+ expect ( outputStream . write ) . toHaveBeenCalledExactlyOnceWith ( 'bar' ) ;
6666} ) ;
6767
6868it ( 'log output is not passed to output stream after it has errored' , ( ) => {
@@ -80,17 +80,17 @@ it('log output is not passed to output stream after it has errored', () => {
8080it ( 'spawns commands up to configured limit at once' , ( ) => {
8181 create ( [ 'foo' , 'bar' , 'baz' , 'qux' ] , { maxProcesses : 2 } ) ;
8282 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
83- expect ( spawn ) . toHaveBeenCalledWith ( 'foo' , expect . objectContaining ( { } ) ) ;
84- expect ( spawn ) . toHaveBeenCalledWith ( 'bar' , expect . objectContaining ( { } ) ) ;
83+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'foo' , expect . objectContaining ( { } ) ) ;
84+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'bar' , expect . objectContaining ( { } ) ) ;
8585
8686 // Test out of order completion picking up new processes in-order
8787 processes [ 1 ] . emit ( 'close' , 1 , null ) ;
8888 expect ( spawn ) . toHaveBeenCalledTimes ( 3 ) ;
89- expect ( spawn ) . toHaveBeenCalledWith ( 'baz' , expect . objectContaining ( { } ) ) ;
89+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'baz' , expect . objectContaining ( { } ) ) ;
9090
9191 processes [ 0 ] . emit ( 'close' , null , 'SIGINT' ) ;
9292 expect ( spawn ) . toHaveBeenCalledTimes ( 4 ) ;
93- expect ( spawn ) . toHaveBeenCalledWith ( 'qux' , expect . objectContaining ( { } ) ) ;
93+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'qux' , expect . objectContaining ( { } ) ) ;
9494
9595 // Shouldn't attempt to spawn anything else.
9696 processes [ 2 ] . emit ( 'close' , 1 , null ) ;
@@ -112,18 +112,18 @@ it('spawns commands up to percent based limit at once', () => {
112112
113113 // Max parallel processes should be 2 (50% of 4 cores)
114114 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
115- expect ( spawn ) . toHaveBeenCalledWith ( 'foo' , expect . objectContaining ( { } ) ) ;
116- expect ( spawn ) . toHaveBeenCalledWith ( 'bar' , expect . objectContaining ( { } ) ) ;
115+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'foo' , expect . objectContaining ( { } ) ) ;
116+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'bar' , expect . objectContaining ( { } ) ) ;
117117
118118 // Close first process and expect third to be spawned
119119 processes [ 0 ] . emit ( 'close' , 1 , null ) ;
120120 expect ( spawn ) . toHaveBeenCalledTimes ( 3 ) ;
121- expect ( spawn ) . toHaveBeenCalledWith ( 'baz' , expect . objectContaining ( { } ) ) ;
121+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'baz' , expect . objectContaining ( { } ) ) ;
122122
123123 // Close second process and expect fourth to be spawned
124124 processes [ 1 ] . emit ( 'close' , 1 , null ) ;
125125 expect ( spawn ) . toHaveBeenCalledTimes ( 4 ) ;
126- expect ( spawn ) . toHaveBeenCalledWith ( 'qux' , expect . objectContaining ( { } ) ) ;
126+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'qux' , expect . objectContaining ( { } ) ) ;
127127} ) ;
128128
129129it ( 'does not spawn further commands on abort signal aborted' , ( ) => {
@@ -140,7 +140,7 @@ it('runs controllers with the commands', () => {
140140 create ( [ 'echo' , '"echo wrapped"' ] ) ;
141141
142142 controllers . forEach ( ( controller ) => {
143- expect ( controller . handle ) . toHaveBeenCalledWith ( [
143+ expect ( controller . handle ) . toHaveBeenCalledExactlyOnceWith ( [
144144 expect . objectContaining ( { command : 'echo' , index : 0 } ) ,
145145 expect . objectContaining ( { command : 'echo wrapped' , index : 1 } ) ,
146146 ] ) ;
@@ -151,7 +151,7 @@ it('runs commands with a name or prefix color', () => {
151151 create ( [ { command : 'echo' , prefixColor : 'red' , name : 'foo' } , 'kill' ] ) ;
152152
153153 controllers . forEach ( ( controller ) => {
154- expect ( controller . handle ) . toHaveBeenCalledWith ( [
154+ expect ( controller . handle ) . toHaveBeenCalledExactlyOnceWith ( [
155155 expect . objectContaining ( { command : 'echo' , index : 0 , name : 'foo' , prefixColor : 'red' } ) ,
156156 expect . objectContaining ( { command : 'kill' , index : 1 , name : '' , prefixColor : '' } ) ,
157157 ] ) ;
@@ -164,7 +164,7 @@ it('runs commands with a list of colors', () => {
164164 } ) ;
165165
166166 controllers . forEach ( ( controller ) => {
167- expect ( controller . handle ) . toHaveBeenCalledWith ( [
167+ expect ( controller . handle ) . toHaveBeenCalledExactlyOnceWith ( [
168168 expect . objectContaining ( { command : 'echo' , prefixColor : 'red' } ) ,
169169 expect . objectContaining ( { command : 'kill' , prefixColor : 'red' } ) ,
170170 ] ) ;
@@ -177,11 +177,11 @@ it('passes commands wrapped from a controller to the next one', () => {
177177
178178 create ( [ 'echo' ] ) ;
179179
180- expect ( controllers [ 0 ] . handle ) . toHaveBeenCalledWith ( [
180+ expect ( controllers [ 0 ] . handle ) . toHaveBeenCalledExactlyOnceWith ( [
181181 expect . objectContaining ( { command : 'echo' , index : 0 } ) ,
182182 ] ) ;
183183
184- expect ( controllers [ 1 ] . handle ) . toHaveBeenCalledWith ( [ fakeCommand ] ) ;
184+ expect ( controllers [ 1 ] . handle ) . toHaveBeenCalledExactlyOnceWith ( [ fakeCommand ] ) ;
185185
186186 expect ( fakeCommand . start ) . toHaveBeenCalledTimes ( 1 ) ;
187187} ) ;
@@ -194,19 +194,19 @@ it('merges extra env vars into each command', () => {
194194 ] ) ;
195195
196196 expect ( spawn ) . toHaveBeenCalledTimes ( 3 ) ;
197- expect ( spawn ) . toHaveBeenCalledWith (
197+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
198198 'echo' ,
199199 expect . objectContaining ( {
200200 env : expect . objectContaining ( { foo : 'bar' } ) ,
201201 } ) ,
202202 ) ;
203- expect ( spawn ) . toHaveBeenCalledWith (
203+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
204204 'echo' ,
205205 expect . objectContaining ( {
206206 env : expect . objectContaining ( { foo : 'baz' } ) ,
207207 } ) ,
208208 ) ;
209- expect ( spawn ) . toHaveBeenCalledWith (
209+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
210210 'kill' ,
211211 expect . objectContaining ( {
212212 env : expect . not . objectContaining ( { foo : expect . anything ( ) } ) ,
@@ -227,21 +227,21 @@ it('uses cwd from options for each command', () => {
227227 ) ;
228228
229229 expect ( spawn ) . toHaveBeenCalledTimes ( 3 ) ;
230- expect ( spawn ) . toHaveBeenCalledWith (
230+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
231231 'echo' ,
232232 expect . objectContaining ( {
233233 env : expect . objectContaining ( { foo : 'bar' } ) ,
234234 cwd : 'foobar' ,
235235 } ) ,
236236 ) ;
237- expect ( spawn ) . toHaveBeenCalledWith (
237+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
238238 'echo' ,
239239 expect . objectContaining ( {
240240 env : expect . objectContaining ( { foo : 'baz' } ) ,
241241 cwd : 'foobar' ,
242242 } ) ,
243243 ) ;
244- expect ( spawn ) . toHaveBeenCalledWith (
244+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
245245 'kill' ,
246246 expect . objectContaining ( {
247247 env : expect . not . objectContaining ( { foo : expect . anything ( ) } ) ,
@@ -262,14 +262,14 @@ it('uses overridden cwd option for each command if specified', () => {
262262 ) ;
263263
264264 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
265- expect ( spawn ) . toHaveBeenCalledWith (
265+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
266266 'echo' ,
267267 expect . objectContaining ( {
268268 env : expect . objectContaining ( { foo : 'bar' } ) ,
269269 cwd : 'baz' ,
270270 } ) ,
271271 ) ;
272- expect ( spawn ) . toHaveBeenCalledWith (
272+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
273273 'echo' ,
274274 expect . objectContaining ( {
275275 env : expect . objectContaining ( { foo : 'baz' } ) ,
@@ -284,13 +284,13 @@ it('uses raw from options for each command', () => {
284284 } ) ;
285285
286286 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
287- expect ( spawn ) . toHaveBeenCalledWith (
287+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
288288 'echo' ,
289289 expect . objectContaining ( {
290290 stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
291291 } ) ,
292292 ) ;
293- expect ( spawn ) . toHaveBeenCalledWith (
293+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
294294 'kill' ,
295295 expect . objectContaining ( {
296296 stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
@@ -304,13 +304,13 @@ it('uses overridden raw option for each command if specified', () => {
304304 } ) ;
305305
306306 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
307- expect ( spawn ) . toHaveBeenCalledWith (
307+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
308308 'echo' ,
309309 expect . objectContaining ( {
310310 stdio : [ 'pipe' , 'pipe' , 'pipe' ] ,
311311 } ) ,
312312 ) ;
313- expect ( spawn ) . toHaveBeenCalledWith (
313+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
314314 'echo' ,
315315 expect . objectContaining ( {
316316 stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
@@ -324,13 +324,13 @@ it('uses hide from options for each command', () => {
324324 } ) ;
325325
326326 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
327- expect ( spawn ) . toHaveBeenCalledWith (
327+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
328328 'echo' ,
329329 expect . objectContaining ( {
330330 stdio : [ 'pipe' , 'pipe' , 'pipe' ] ,
331331 } ) ,
332332 ) ;
333- expect ( spawn ) . toHaveBeenCalledWith (
333+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
334334 'kill' ,
335335 expect . objectContaining ( {
336336 stdio : [ 'pipe' , 'ignore' , 'ignore' ] ,
@@ -345,13 +345,13 @@ it('hides output for commands even if raw option is on', () => {
345345 } ) ;
346346
347347 expect ( spawn ) . toHaveBeenCalledTimes ( 2 ) ;
348- expect ( spawn ) . toHaveBeenCalledWith (
348+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
349349 'echo' ,
350350 expect . objectContaining ( {
351351 stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
352352 } ) ,
353353 ) ;
354- expect ( spawn ) . toHaveBeenCalledWith (
354+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith (
355355 'kill' ,
356356 expect . objectContaining ( {
357357 stdio : [ 'pipe' , 'ignore' , 'ignore' ] ,
@@ -373,10 +373,10 @@ it('argument placeholders are properly replaced when additional arguments are pa
373373 ) ;
374374
375375 expect ( spawn ) . toHaveBeenCalledTimes ( 4 ) ;
376- expect ( spawn ) . toHaveBeenCalledWith ( 'echo foo' , expect . objectContaining ( { } ) ) ;
377- expect ( spawn ) . toHaveBeenCalledWith ( 'echo foo bar' , expect . objectContaining ( { } ) ) ;
378- expect ( spawn ) . toHaveBeenCalledWith ( "echo 'foo bar'" , expect . objectContaining ( { } ) ) ;
379- expect ( spawn ) . toHaveBeenCalledWith ( 'echo {@}' , expect . objectContaining ( { } ) ) ;
376+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo foo' , expect . objectContaining ( { } ) ) ;
377+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo foo bar' , expect . objectContaining ( { } ) ) ;
378+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( "echo 'foo bar'" , expect . objectContaining ( { } ) ) ;
379+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo {@}' , expect . objectContaining ( { } ) ) ;
380380} ) ;
381381
382382it ( 'argument placeholders are not replaced when additional arguments are not defined' , ( ) => {
@@ -388,10 +388,10 @@ it('argument placeholders are not replaced when additional arguments are not def
388388 ] ) ;
389389
390390 expect ( spawn ) . toHaveBeenCalledTimes ( 4 ) ;
391- expect ( spawn ) . toHaveBeenCalledWith ( 'echo {1}' , expect . objectContaining ( { } ) ) ;
392- expect ( spawn ) . toHaveBeenCalledWith ( 'echo {@}' , expect . objectContaining ( { } ) ) ;
393- expect ( spawn ) . toHaveBeenCalledWith ( 'echo {*}' , expect . objectContaining ( { } ) ) ;
394- expect ( spawn ) . toHaveBeenCalledWith ( 'echo {@}' , expect . objectContaining ( { } ) ) ;
391+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo {1}' , expect . objectContaining ( { } ) ) ;
392+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo {@}' , expect . objectContaining ( { } ) ) ;
393+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo {*}' , expect . objectContaining ( { } ) ) ;
394+ expect ( spawn ) . toHaveBeenCalledExactlyOnceWith ( 'echo {@}' , expect . objectContaining ( { } ) ) ;
395395} ) ;
396396
397397it ( 'runs onFinish hook after all commands run' , async ( ) => {
0 commit comments