test: add retries to another beforeunload test (#23644)

This commit is contained in:
Jeremy Apthorp 2020-05-18 19:06:19 -07:00 committed by GitHub
parent c00103d274
commit 01579cc8ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,7 +185,9 @@ describe('BrowserWindow module', () => {
fs.unlinkSync(test); fs.unlinkSync(test);
expect(content).to.equal('close'); expect(content).to.equal('close');
}); });
it('should emit beforeunload event', async () => { it('should emit beforeunload event', async function () {
// TODO(nornagon): deflake this test.
this.retries(3);
await w.loadFile(path.join(__dirname, 'fixtures', 'api', 'close-beforeunload-false.html')); await w.loadFile(path.join(__dirname, 'fixtures', 'api', 'close-beforeunload-false.html'));
w.webContents.executeJavaScript('run()', true); w.webContents.executeJavaScript('run()', true);
const [e] = await emittedOnce(ipcMain, 'onbeforeunload'); const [e] = await emittedOnce(ipcMain, 'onbeforeunload');