Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj authored Oct 26, 2022
1 parent 6f4e129 commit 47a9185
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/concurrently.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ it('spawns commands up to percent based limit at once', () => {

create(['foo', 'bar', 'baz', 'qux'], { maxProcesses: '50%' });

// Max parallel processes should be 50% of 4
// Max parallel processes should be 2 (50% of 4 cores)
expect(spawn).toHaveBeenCalledTimes(2);
expect(spawn).toHaveBeenCalledWith('foo', expect.objectContaining({}));
expect(spawn).toHaveBeenCalledWith('bar', expect.objectContaining({}));

// Close first process
// Close first process and expect third to be spawned
processes[0].emit('close', 1, null);
expect(spawn).toHaveBeenCalledTimes(3);
expect(spawn).toHaveBeenCalledWith('baz', expect.objectContaining({}));

// Close second process
// Close second process and expect fourth to be spawned
processes[1].emit('close', 1, null);
expect(spawn).toHaveBeenCalledTimes(4);
expect(spawn).toHaveBeenCalledWith('qux', expect.objectContaining({}));
Expand Down

0 comments on commit 47a9185

Please sign in to comment.