Skip to content

Commit

Permalink
Adjust tests accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus-and authored Jul 29, 2023
1 parent c6e3da6 commit 1ae1e8f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 1ae1e8f

Please sign in to comment.