1717 * Protocol test suite to test protocol implementations
1818 */
1919
20- import Servient , { createLoggers , ExposedThing } from "@node-wot/core" ;
20+ import Servient , { createLoggers } from "@node-wot/core" ;
2121import { suite , test } from "@testdeck/mocha" ;
2222import { expect , should } from "chai" ;
2323import WebSocketServer from "../src/ws-server" ;
@@ -54,7 +54,7 @@ class WebSocketsTest {
5454 const receivedConnections : string [ ] = [ ] ;
5555
5656 mockServer . on ( "connection" , ( ws , req ) => {
57- receivedConnections . push ( req . url || "/" ) ;
57+ receivedConnections . push ( req . url ?? "/" ) ;
5858 ws . on ( "message" , ( msg ) => {
5959 const data = JSON . parse ( msg . toString ( ) ) ;
6060 // Echo back with id
@@ -77,8 +77,8 @@ class WebSocketsTest {
7777 } ;
7878
7979 // Both should succeed and connect to different paths
80- const result1 = await client . readResource ( form1 ) ;
81- const result2 = await client . readResource ( form2 ) ;
80+ await client . readResource ( form1 ) ;
81+ await client . readResource ( form2 ) ;
8282
8383 expect ( receivedConnections ) . to . include ( "/endpoint1" ) ;
8484 expect ( receivedConnections ) . to . include ( "/endpoint2" ) ;
@@ -181,12 +181,7 @@ class WebSocketsTest {
181181 op : "subscribeproperty" ,
182182 } ;
183183
184- const subscription = await client . subscribeResource (
185- form ,
186- ( ) => { } ,
187- undefined ,
188- undefined
189- ) ;
184+ await client . subscribeResource ( form , ( ) => { } , undefined , undefined ) ;
190185
191186 // Unsubscribe should trigger the correct operation
192187 await client . unlinkResource ( form ) ;
@@ -247,12 +242,7 @@ class WebSocketsTest {
247242 op : "subscribeevent" ,
248243 } ;
249244
250- const subscription = await client . subscribeResource (
251- form ,
252- ( ) => { } ,
253- undefined ,
254- undefined
255- ) ;
245+ await client . subscribeResource ( form , ( ) => { } , undefined , undefined ) ;
256246
257247 // Unsubscribe should trigger the correct operation
258248 await client . unlinkResource ( form ) ;
0 commit comments