chore: update to standard 12

This commit is contained in:
Samuel Attard 2018-09-14 02:10:51 +10:00
parent 9e85bdb02c
commit 558fff69e7
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
198 changed files with 4455 additions and 2940 deletions

View file

@ -2,12 +2,12 @@ const assert = require('assert')
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const path = require('path')
const {closeWindow} = require('./window-helpers')
const {remote, webFrame} = require('electron')
const {BrowserWindow, protocol, ipcMain} = remote
const {emittedOnce} = require('./events-helpers')
const { closeWindow } = require('./window-helpers')
const { remote, webFrame } = require('electron')
const { BrowserWindow, protocol, ipcMain } = remote
const { emittedOnce } = require('./events-helpers')
const {expect} = chai
const { expect } = chai
chai.use(dirtyChai)
/* Most of the APIs here don't use standard callbacks */
@ -109,7 +109,7 @@ describe('webFrame module', function () {
runNumber++
const url = standardScheme + '://fake-host'
w = new BrowserWindow({show: false})
w = new BrowserWindow({ show: false })
after(function (done) {
protocol.unregisterProtocol(corsScheme, function () {
protocol.unregisterProtocol(standardScheme, function () {
@ -119,7 +119,7 @@ describe('webFrame module', function () {
})
const handler = function (request, callback) {
callback({data: content, mimeType: 'text/html'})
callback({ data: content, mimeType: 'text/html' })
}
protocol.registerStringProtocol(standardScheme, handler, function (error) {
if (error) return done(error)
@ -130,7 +130,7 @@ describe('webFrame module', function () {
}, function (error) {
if (error) return done(error)
ipcMain.once('response', function (event, status) {
assert.equal(status, expected)
assert.strictEqual(status, expected)
done()
})
w.loadURL(url)
@ -146,14 +146,14 @@ describe('webFrame module', function () {
})
it('calls a spellcheck provider', async () => {
w = new BrowserWindow({show: false})
w = new BrowserWindow({ show: false })
w.loadFile(path.join(fixtures, 'pages', 'webframe-spell-check.html'))
await emittedOnce(w.webContents, 'did-finish-load')
const spellCheckerFeedback = emittedOnce(ipcMain, 'spec-spell-check')
const misspelledWord = 'spleling'
for (const keyCode of [...misspelledWord, ' ']) {
w.webContents.sendInputEvent({type: 'char', keyCode})
w.webContents.sendInputEvent({ type: 'char', keyCode })
}
const [, text] = await spellCheckerFeedback
expect(text).to.equal(misspelledWord)