From 0980e5bd284b1e260eb11253d788c3c6fc733d94 Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Tue, 21 Jun 2022 12:49:49 +0200 Subject: [PATCH] Fix timeout issue when testing on macOS / Windows in CI (#333) --- bin/concurrently.spec.ts | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/bin/concurrently.spec.ts b/bin/concurrently.spec.ts index 9da45377..11fb5068 100644 --- a/bin/concurrently.spec.ts +++ b/bin/concurrently.spec.ts @@ -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)')); @@ -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 => {