From 196b374fdbd12a3c9002a0da4e6bf902adf8940f Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 11 Apr 2019 13:32:32 +0100 Subject: [PATCH] fix: flakey windows test License: MIT Signed-off-by: Alan Shaw --- test/cli/daemon.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cli/daemon.js b/test/cli/daemon.js index afebfbbc41..d444134531 100644 --- a/test/cli/daemon.js +++ b/test/cli/daemon.js @@ -109,7 +109,7 @@ describe('daemon', () => { await ipfs('config', 'Addresses.API', JSON.stringify(apiAddrs), '--json') await ipfs('config', 'Addresses.Gateway', JSON.stringify(gatewayAddrs), '--json') - const out = await new Promise(resolve => { + const out = await new Promise((resolve, reject) => { const res = ipfs('daemon') let out = '' @@ -117,8 +117,8 @@ describe('daemon', () => { out += data if (out.includes('Daemon is ready')) { res.stdout.removeListener('data', onData) + res.then(() => resolve(out)).catch(reject) res.kill() - resolve(out) } }) }) @@ -134,7 +134,7 @@ describe('daemon', () => { await ipfs('config', 'Addresses.API', '[]', '--json') await ipfs('config', 'Addresses.Gateway', '[]', '--json') - const out = await new Promise(resolve => { + const out = await new Promise((resolve, reject) => { const res = ipfs('daemon') let out = '' @@ -142,8 +142,8 @@ describe('daemon', () => { out += data if (out.includes('Daemon is ready')) { res.stdout.removeListener('data', onData) + res.then(() => resolve(out)).catch(reject) res.kill() - resolve(out) } }) })