Skip to content

Commit

Permalink
Fix timeout issue when testing on macOS / Windows in CI (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Jun 21, 2022
1 parent 29b18f8 commit 0980e5b
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions bin/concurrently.spec.ts
Expand Up @@ -4,6 +4,10 @@ import * as Rx from 'rxjs';
import { buffer, map } from 'rxjs/operators';
import spawn from 'spawn-command';

// Increasing timeout for these tests as sometimes it exceeded
// in the CI when running on macOS / Windows (default is 5000ms)
jest.setTimeout(10000);

const isWindows = process.platform === 'win32';
const createKillMessage = (prefix: string) =>
new RegExp(_.escapeRegExp(prefix) + ' exited with code ' + (isWindows ? 1 : '(SIGTERM|143)'));
Expand Down Expand Up @@ -54,24 +58,17 @@ it('has help command', done => {
}, done);
});

// Increasing timeout for this test as it is sometimes exceeded
// in the CI when running on macOS (default is 5000ms)
const increasedTimeout = 10000;
it(
'has version command',
done => {
Rx.combineLatest([run('--version').close, run('-V').close, run('-v').close]).subscribe(
events => {
expect(events[0][0]).toBe(0);
expect(events[1][0]).toBe(0);
expect(events[2][0]).toBe(0);
done();
},
done
);
},
increasedTimeout
);
it('has version command', done => {
Rx.combineLatest([run('--version').close, run('-V').close, run('-v').close]).subscribe(
events => {
expect(events[0][0]).toBe(0);
expect(events[1][0]).toBe(0);
expect(events[2][0]).toBe(0);
done();
},
done
);
});

describe('exiting conditions', () => {
it('is of success by default when running successful commands', done => {
Expand Down

0 comments on commit 0980e5b

Please sign in to comment.