Handle the possibility of unexpected logs.
This commit is contained in:
parent
e51042f5a1
commit
51f6311f32
1 changed files with 4 additions and 2 deletions
|
@ -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`)
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue