From 28b150f6dc71fd8229e9e26d850a5bbd3281d62b Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Fri, 22 Feb 2019 16:45:48 -0800 Subject: [PATCH] test: fix race condition in debugger spec (#17091) --- spec/api-debugger-spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/api-debugger-spec.js b/spec/api-debugger-spec.js index 16f38985e12f..fe687ca12c42 100644 --- a/spec/api-debugger-spec.js +++ b/spec/api-debugger-spec.js @@ -142,8 +142,9 @@ describe('debugger module', () => { w.webContents.loadURL('about:blank') w.webContents.debugger.attach() + const opened = emittedOnce(w.webContents, 'devtools-opened') w.webContents.openDevTools() - await emittedOnce(w.webContents, 'devtools-opened') + await opened const params = { 'expression': '4+2' } const res = await w.webContents.debugger.sendCommand('Runtime.evaluate', params)