Skip to content
Snippets Groups Projects
Verified Commit 54082d0f authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: check read/write call

parent 936a5332
No related branches found
No related tags found
No related merge requests found
......@@ -236,7 +236,7 @@ class WebSocketDatasource extends Datasource {
const self = this;
let response;
if (self[connectionSymbol].socket||self[connectionSymbol].socket.readyState!==1) {
if (self[connectionSymbol]?.socket?.readyState!==1) {
return Promise.reject('The connection is not established.');
}
......@@ -292,7 +292,7 @@ class WebSocketDatasource extends Datasource {
write() {
const self = this;
if (self[connectionSymbol].socket||self[connectionSymbol].socket.readyState!==1) {
if (self[connectionSymbol]?.socket?.readyState!==1) {
return Promise.reject('The connection is not established.');
}
......
......@@ -98,7 +98,8 @@ describe('Websocket', function () {
}).catch((err) => {
done(new Error(err));
})
}, 1000)
},
500)
}).timeout(10000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment