From 5c6b03cd405b03a0e6bf52132d7ada3674aca188 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Thu, 27 Oct 2016 14:35:13 +0200 Subject: [PATCH] wip --- e2e-tests/__tests__/cli-arg-port.js | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/e2e-tests/__tests__/cli-arg-port.js b/e2e-tests/__tests__/cli-arg-port.js index bf254da37..bc6e2da05 100644 --- a/e2e-tests/__tests__/cli-arg-port.js +++ b/e2e-tests/__tests__/cli-arg-port.js @@ -8,13 +8,14 @@ import { it("should NOT throw if port is used", () => new Promise((resolve, reject) => { + let child const app = require("express")() const server = app.listen(3333, (err) => { if (err) { reject(err) } - const child = exec( + child = exec( `${ phenomic } start --open=false --devPort=3333`, execOpts, (err) => { @@ -24,18 +25,20 @@ it("should NOT throw if port is used", } } ) - - // server need to be killed manually - const timeout = setTimeout(() => { - console.log("********** CLOSIINGGGGG*************") - console.log("********** CLOSIINGGGGG*************") - console.log("********** CLOSIINGGGGG*************") - console.log("********** CLOSIINGGGGG*************") - console.log("********** CLOSIINGGGGG*************") - console.log("********** CLOSIINGGGGG*************") - server.close() - child.kill("SIGKILL") - resolve() - }, timing) }) + + // server need to be killed manually + const timeout = setTimeout(() => { + console.log("********** CLOSIINGGGGG*************") + console.log("********** CLOSIINGGGGG*************") + console.log("********** CLOSIINGGGGG*************") + console.log("********** CLOSIINGGGGG*************") + console.log("********** CLOSIINGGGGG*************") + console.log("********** CLOSIINGGGGG*************") + console.log(server.close()) + if (child) { + console.log(child.kill("SIGKILL")) + } + resolve() + }, timing) }), maxTimeout)