From dcd5823a17f21a932d36317f25dd3b91d37710c5 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Mon, 23 Sep 2019 11:47:53 +0200 Subject: [PATCH] Fix concurrent tests. Running jest runs the two test suites in parallel. If both try to run a server on port 3000, only one of them will succeed and supply files for both, however when that suite finishes first, it will take down the server and leave the other one hanging. Fix this by running the servers on different ports. --- integration/widget.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/widget.test.js b/integration/widget.test.js index dd838ac..2362b9a 100644 --- a/integration/widget.test.js +++ b/integration/widget.test.js @@ -3,14 +3,14 @@ const express = require('express'); const puppeteer = require('puppeteer') -const rootUrl = "http://localhost:3000/"; +const rootUrl = "http://localhost:3001/"; jest.setTimeout(500000); const server = new Promise( resolve => { let app = require( '../src/server' )({ directory: path.join( __dirname, '..' ) }); let server; - server = app.listen( 3000, () => resolve(server) ); + server = app.listen( 3001, () => resolve(server) ); }).catch( e => console.log(e) ); const browser = puppeteer.launch({ headless: false });