mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Handle the possibility of unexpected logs.
This commit is contained in:
@@ -671,8 +671,10 @@ describe('webContents module', () => {
|
||||
describe('console-message event', () => {
|
||||
it('is triggered with correct log message', (done) => {
|
||||
w.webContents.on('console-message', (e, level, message) => {
|
||||
assert.equal(message, 'a')
|
||||
done()
|
||||
// Don't just assert as Chromium might emit other logs that we should ignore.
|
||||
if (message === 'a') {
|
||||
done()
|
||||
}
|
||||
})
|
||||
w.loadURL(`file://${fixtures}/pages/a.html`)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user