Browse Source

test: attempt to fix flaky webview.clearHistory test (#19083)

Jeremy Apthorp 5 years ago
parent
commit
c2d78deeca
1 changed files with 3 additions and 2 deletions
  1. 3 2
      spec/webview-spec.js

+ 3 - 2
spec/webview-spec.js

@@ -917,11 +917,12 @@ describe('<webview> tag', function () {
 
   describe('<webview>.clearHistory()', () => {
     it('should clear the navigation history', async () => {
-      loadWebView(webview, {
+      const message = waitForEvent(webview, 'ipc-message')
+      await loadWebView(webview, {
         nodeintegration: 'on',
         src: `file://${fixtures}/pages/history.html`
       })
-      const event = await waitForEvent(webview, 'ipc-message')
+      const event = await message
 
       expect(event.channel).to.equal('history')
       expect(event.args[0]).to.equal(2)