test: fix race condition in debugger spec (#17091)

This commit is contained in:
Jeremy Apthorp 2019-02-22 16:45:48 -08:00 committed by GitHub
parent 5be93566ee
commit 28b150f6dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)