From fd9344cf588bd37b83e986e8d2d0a1835f70ab9b Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 21 Oct 2020 15:17:58 -0300 Subject: [PATCH] Revert "use events.once" This reverts commit e4ab5e1d8139e477d24bb4e440eaa3f7f7975f32. --- src/setup-ganache.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/setup-ganache.ts b/src/setup-ganache.ts index 3c6d2dd..15c75d5 100644 --- a/src/setup-ganache.ts +++ b/src/setup-ganache.ts @@ -1,6 +1,5 @@ import path from 'path'; import { fork, ChildProcess } from 'child_process'; -import events from 'events'; import { accountsConfig } from './accounts'; import config from './config'; @@ -50,7 +49,13 @@ export default async function (): Promise { }; server.send(options); - const [message]: Message[] = await events.once(server, 'message'); + const messageReceived: Promise = new Promise( + (resolve): ChildProcess => { + return server.once('message', resolve); + }, + ); + + const message = await messageReceived; switch (message.type) { case 'ready':