chore: finish replacing assert with expect in tests (#18215)

* spec: replace assert with expect in api-browser-view-spec.js

* spec: replace assert with expect in api-touch-bar-spec.js

* spec: replace assert with expect in api-web-frame-spec.js

* spec: replace assert with expect in api-web-contents-view-spec.js

* spec: replace assert with expect in security-warnings-spec.js

* spec: replace assert with expect in api-menu-item-spec.js

* spec: replace assert with expect in api-web-request-spec.js

* spec: replace assert with expect in api-remote-spec.js

* spec: replace assert with expect in api-session-spec.js

* spec: replace assert with expect in api-system-preferences-spec.js

* spec: replace assert with expect in api-browser-window-spec.js

* spec: replace assert with expect in webview-spec.js

* spec: replace assert with expect in api-net-spec.js

* spec: replace assert with expect in api-protocol-spec.js

* spec: replace assert with expect api-web-contents-spec.js

* spec: replace assert with expect in api-shell-spec.js

* spec: replace assert with expect in modules-spec.js

* spec: replace assert with expect in chromium-spec.js

* spec: replace assert with expect in api-crash-reporter-spec.js

* spec: replace assert with expect in asar-spec.js

* spec: rename assert-helpers to expect-helpers

* address PR feedback
This commit is contained in:
Milan Burda 2019-05-20 19:04:18 +02:00 committed by Charles Kerr
parent dbb8617214
commit 5a7b56b042
22 changed files with 1546 additions and 1591 deletions

View file

@ -1,4 +1,6 @@
const assert = require('assert')
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const http = require('http')
const fs = require('fs')
const path = require('path')
@ -9,6 +11,9 @@ const { BrowserWindow } = remote
const { closeWindow } = require('./window-helpers')
const { expect } = chai
chai.use(dirtyChai)
describe('security warnings', () => {
let server
let w = null
@ -66,7 +71,7 @@ describe('security warnings', () => {
}
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('Node.js Integration with Remote Content'), message)
expect(message).to.include('Node.js Integration with Remote Content')
done()
})
@ -84,7 +89,7 @@ describe('security warnings', () => {
}
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('Disabled webSecurity'), message)
expect(message).include('Disabled webSecurity')
done()
})
@ -98,7 +103,7 @@ describe('security warnings', () => {
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('Insecure Content-Security-Policy'), message)
expect(message).to.include('Insecure Content-Security-Policy')
done()
})
@ -115,7 +120,7 @@ describe('security warnings', () => {
}
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('allowRunningInsecureContent'), message)
expect(message).to.include('allowRunningInsecureContent')
done()
})
@ -131,7 +136,7 @@ describe('security warnings', () => {
}
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('experimentalFeatures'), message)
expect(message).to.include('experimentalFeatures')
done()
})
@ -147,7 +152,7 @@ describe('security warnings', () => {
}
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('enableBlinkFeatures'), message)
expect(message).to.include('enableBlinkFeatures')
done()
})
@ -160,7 +165,7 @@ describe('security warnings', () => {
webPreferences
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('allowpopups'), message)
expect(message).to.include('allowpopups')
done()
})
@ -173,7 +178,7 @@ describe('security warnings', () => {
webPreferences
})
w.webContents.once('console-message', (e, level, message) => {
assert(message.includes('Insecure Resources'), message)
expect(message).to.include('Insecure Resources')
done()
})