build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,17 +1,17 @@
|
|||
import { expect } from 'chai'
|
||||
import * as path from 'path'
|
||||
import * as cp from 'child_process'
|
||||
import { closeAllWindows } from './window-helpers'
|
||||
import { emittedOnce } from './events-helpers'
|
||||
import { ipcMain, BrowserWindow } from 'electron'
|
||||
import { expect } from 'chai';
|
||||
import * as path from 'path';
|
||||
import * as cp from 'child_process';
|
||||
import { closeAllWindows } from './window-helpers';
|
||||
import { emittedOnce } from './events-helpers';
|
||||
import { ipcMain, BrowserWindow } from 'electron';
|
||||
|
||||
describe('ipc main module', () => {
|
||||
const fixtures = path.join(__dirname, 'fixtures')
|
||||
const fixtures = path.join(__dirname, 'fixtures');
|
||||
|
||||
afterEach(closeAllWindows)
|
||||
afterEach(closeAllWindows);
|
||||
|
||||
describe('ipc.sendSync', () => {
|
||||
afterEach(() => { ipcMain.removeAllListeners('send-sync-message') })
|
||||
afterEach(() => { ipcMain.removeAllListeners('send-sync-message'); });
|
||||
|
||||
it('does not crash when reply is not sent and browser is destroyed', (done) => {
|
||||
const w = new BrowserWindow({
|
||||
|
@ -19,13 +19,13 @@ describe('ipc main module', () => {
|
|||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
});
|
||||
ipcMain.once('send-sync-message', (event) => {
|
||||
event.returnValue = null
|
||||
done()
|
||||
})
|
||||
w.loadFile(path.join(fixtures, 'api', 'send-sync-message.html'))
|
||||
})
|
||||
event.returnValue = null;
|
||||
done();
|
||||
});
|
||||
w.loadFile(path.join(fixtures, 'api', 'send-sync-message.html'));
|
||||
});
|
||||
|
||||
it('does not crash when reply is sent by multiple listeners', (done) => {
|
||||
const w = new BrowserWindow({
|
||||
|
@ -33,31 +33,31 @@ describe('ipc main module', () => {
|
|||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
});
|
||||
ipcMain.on('send-sync-message', (event) => {
|
||||
event.returnValue = null
|
||||
})
|
||||
event.returnValue = null;
|
||||
});
|
||||
ipcMain.on('send-sync-message', (event) => {
|
||||
event.returnValue = null
|
||||
done()
|
||||
})
|
||||
w.loadFile(path.join(fixtures, 'api', 'send-sync-message.html'))
|
||||
})
|
||||
})
|
||||
event.returnValue = null;
|
||||
done();
|
||||
});
|
||||
w.loadFile(path.join(fixtures, 'api', 'send-sync-message.html'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('ipcMain.on', () => {
|
||||
it('is not used for internals', async () => {
|
||||
const appPath = path.join(fixtures, 'api', 'ipc-main-listeners')
|
||||
const electronPath = process.execPath
|
||||
const appProcess = cp.spawn(electronPath, [appPath])
|
||||
const appPath = path.join(fixtures, 'api', 'ipc-main-listeners');
|
||||
const electronPath = process.execPath;
|
||||
const appProcess = cp.spawn(electronPath, [appPath]);
|
||||
|
||||
let output = ''
|
||||
appProcess.stdout.on('data', (data) => { output += data })
|
||||
let output = '';
|
||||
appProcess.stdout.on('data', (data) => { output += data; });
|
||||
|
||||
await emittedOnce(appProcess.stdout, 'end')
|
||||
await emittedOnce(appProcess.stdout, 'end');
|
||||
|
||||
output = JSON.parse(output)
|
||||
expect(output).to.deep.equal(['error'])
|
||||
})
|
||||
})
|
||||
})
|
||||
output = JSON.parse(output);
|
||||
expect(output).to.deep.equal(['error']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue