From 1ae1e8fc35222e133c3c875d038e29968760d239 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sat, 29 Jul 2023 13:48:25 +0200 Subject: [PATCH] Adjust tests accordingly --- test/send.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/send.js b/test/send.js index 0e96856..ddc63cf 100644 --- a/test/send.js +++ b/test/send.js @@ -81,15 +81,17 @@ describe('sending a command', () => { }); it('should catch WebSocket errors after command send', (done) => { Chrome((chrome) => { - let result; - chrome.Page.enable((err, res)=>{ - result = res; - }); - chrome.close(()=>{ - assert(result instanceof Error); - assert(result.message === 'WebSocket connection closed'); + chrome.Runtime.evaluate({ + expression: 'new Promise(_ => _)', + awaitPromise: true + }, (error, response) => { + assert(error instanceof Error); + assert(!error.request); + assert(!error.response); + assert(!response); done(); }); + chrome.close(); }); }); describe('without a callback', () => {