@@ -7,6 +7,7 @@ import { Server } from "..";
77import { io as ioc , Socket as ClientSocket } from "socket.io-client" ;
88import request from "supertest" ;
99import expect from "expect.js" ;
10+ import { assert } from "./support/util" ;
1011
1112const createPartialDone = ( done : ( err ?: Error ) => void , count : number ) => {
1213 let i = 0 ;
@@ -134,6 +135,8 @@ describe("socket.io with uWebSocket.js-based engine", () => {
134135 clientWSOnly . on ( "hello" , partialDone ) ;
135136 clientPollingOnly . on ( "hello" , partialDone ) ;
136137 clientCustomNamespace . on ( "hello" , shouldNotHappen ( done ) ) ;
138+ assert ( clientWSOnly . id ) ;
139+ assert ( clientPollingOnly . id ) ;
137140
138141 io . of ( "/" ) . sockets . get ( clientWSOnly . id ) ! . join ( "room1" ) ;
139142 io . of ( "/" ) . sockets . get ( clientPollingOnly . id ) ! . join ( "room1" ) ;
@@ -148,6 +151,8 @@ describe("socket.io with uWebSocket.js-based engine", () => {
148151 clientWSOnly . on ( "hello" , partialDone ) ;
149152 clientPollingOnly . on ( "hello" , partialDone ) ;
150153 clientCustomNamespace . on ( "hello" , shouldNotHappen ( done ) ) ;
154+ assert ( clientWSOnly . id ) ;
155+ assert ( clientPollingOnly . id ) ;
151156
152157 io . of ( "/" ) . sockets . get ( clientWSOnly . id ) ! . join ( "room1" ) ;
153158 io . of ( "/" ) . sockets . get ( clientPollingOnly . id ) ! . join ( "room2" ) ;
@@ -163,6 +168,8 @@ describe("socket.io with uWebSocket.js-based engine", () => {
163168 clientPollingOnly . on ( "hello" , shouldNotHappen ( done ) ) ;
164169 clientCustomNamespace . on ( "hello" , shouldNotHappen ( done ) ) ;
165170
171+ assert ( clientWSOnly . id ) ;
172+ assert ( clientPollingOnly . id ) ;
166173 io . of ( "/" ) . sockets . get ( clientWSOnly . id ) ! . join ( "room1" ) ;
167174 io . of ( "/" ) . sockets . get ( clientPollingOnly . id ) ! . join ( "room2" ) ;
168175
@@ -177,6 +184,9 @@ describe("socket.io with uWebSocket.js-based engine", () => {
177184 clientPollingOnly . on ( "hello" , partialDone ) ;
178185 clientCustomNamespace . on ( "hello" , shouldNotHappen ( done ) ) ;
179186
187+ assert ( client . id ) ;
188+ assert ( clientWSOnly . id ) ;
189+ assert ( clientPollingOnly . id ) ;
180190 io . of ( "/" ) . sockets . get ( client . id ) ! . join ( "room1" ) ;
181191 io . of ( "/" ) . sockets . get ( clientPollingOnly . id ) ! . join ( "room1" ) ;
182192
@@ -189,6 +199,7 @@ describe("socket.io with uWebSocket.js-based engine", () => {
189199 it ( "should not crash when socket is disconnected before the upgrade" , ( done ) => {
190200 client . on ( "disconnect" , ( ) => done ( ) ) ;
191201
202+ assert ( client . id ) ;
192203 io . of ( "/" ) . sockets . get ( client . id ) ! . disconnect ( ) ;
193204 } ) ;
194205
0 commit comments