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

@ -1,9 +1,9 @@
const assert = require('assert')
const Module = require('module')
const path = require('path')
const {remote} = require('electron')
const {BrowserWindow} = remote
const {closeWindow} = require('./window-helpers')
const { remote } = require('electron')
const { BrowserWindow } = remote
const { closeWindow } = require('./window-helpers')
const nativeModulesEnabled = remote.getGlobal('nativeModulesEnabled')
@ -20,7 +20,7 @@ describe('modules support', () => {
const runas = path.join(fixtures, 'module', 'runas.js')
const child = require('child_process').fork(runas)
child.on('message', (msg) => {
assert.equal(msg, 'ok')
assert.strictEqual(msg, 'ok')
done()
})
})
@ -42,7 +42,7 @@ describe('modules support', () => {
const libm = ffi.Library('libm', {
ceil: ['double', ['double']]
})
assert.equal(libm.ceil(1.5), 2)
assert.strictEqual(libm.ceil(1.5), 2)
})
})
@ -51,7 +51,7 @@ describe('modules support', () => {
describe('Q.when', () => {
it('emits the fullfil callback', (done) => {
Q(true).then((val) => {
assert.equal(val, true)
assert.strictEqual(val, true)
done()
})
})
@ -92,7 +92,7 @@ describe('modules support', () => {
describe('when the path is inside the resources path', () => {
it('does not include paths outside of the resources path', () => {
let modulePath = process.resourcesPath
assert.deepEqual(Module._nodeModulePaths(modulePath), [
assert.deepStrictEqual(Module._nodeModulePaths(modulePath), [
path.join(process.resourcesPath, 'node_modules')
])
@ -102,26 +102,26 @@ describe('modules support', () => {
assert(nodeModulePaths.includes(path.join(modulePath, '..', 'node_modules')))
modulePath = path.join(process.resourcesPath, 'foo')
assert.deepEqual(Module._nodeModulePaths(modulePath), [
assert.deepStrictEqual(Module._nodeModulePaths(modulePath), [
path.join(process.resourcesPath, 'foo', 'node_modules'),
path.join(process.resourcesPath, 'node_modules')
])
modulePath = path.join(process.resourcesPath, 'node_modules', 'foo')
assert.deepEqual(Module._nodeModulePaths(modulePath), [
assert.deepStrictEqual(Module._nodeModulePaths(modulePath), [
path.join(process.resourcesPath, 'node_modules', 'foo', 'node_modules'),
path.join(process.resourcesPath, 'node_modules')
])
modulePath = path.join(process.resourcesPath, 'node_modules', 'foo', 'bar')
assert.deepEqual(Module._nodeModulePaths(modulePath), [
assert.deepStrictEqual(Module._nodeModulePaths(modulePath), [
path.join(process.resourcesPath, 'node_modules', 'foo', 'bar', 'node_modules'),
path.join(process.resourcesPath, 'node_modules', 'foo', 'node_modules'),
path.join(process.resourcesPath, 'node_modules')
])
modulePath = path.join(process.resourcesPath, 'node_modules', 'foo', 'node_modules', 'bar')
assert.deepEqual(Module._nodeModulePaths(modulePath), [
assert.deepStrictEqual(Module._nodeModulePaths(modulePath), [
path.join(process.resourcesPath, 'node_modules', 'foo', 'node_modules', 'bar', 'node_modules'),
path.join(process.resourcesPath, 'node_modules', 'foo', 'node_modules'),
path.join(process.resourcesPath, 'node_modules')
@ -132,7 +132,7 @@ describe('modules support', () => {
describe('when the path is outside the resources path', () => {
it('includes paths outside of the resources path', () => {
let modulePath = path.resolve('/foo')
assert.deepEqual(Module._nodeModulePaths(modulePath), [
assert.deepStrictEqual(Module._nodeModulePaths(modulePath), [
path.join(modulePath, 'node_modules'),
path.resolve('/node_modules')
])
@ -145,7 +145,7 @@ describe('modules support', () => {
let w
beforeEach(() => {
w = new BrowserWindow({show: false})
w = new BrowserWindow({ show: false })
})
afterEach(async () => {
@ -156,7 +156,7 @@ describe('modules support', () => {
it('searches for module under app directory', async () => {
w.loadURL('about:blank')
const result = await w.webContents.executeJavaScript('typeof require("q").when')
assert.equal(result, 'function')
assert.strictEqual(result, 'function')
})
})
})