File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,21 @@ class SocketSideEffectTest: XCTestCase {
355
355
waitForExpectations ( timeout: 2 )
356
356
}
357
357
358
+ func testConnectedAlready( ) {
359
+ let expect = expectation ( description: " The client should call its handler if it's connected already " )
360
+ let nspString = " /swift "
361
+
362
+ socket. setTestStatus ( . connected)
363
+ socket. nsp = " /someNamespace "
364
+ socket. engine = TestEngine ( client: socket, url: socket. socketURL, options: nil )
365
+
366
+ socket. connect ( timeoutAfter: 0.5 , withHandler: {
367
+ expect. fulfill ( )
368
+ } )
369
+
370
+ waitForExpectations ( timeout: 0.8 )
371
+ }
372
+
358
373
func testErrorInCustomSocketDataCallsErrorHandler( ) {
359
374
let expect = expectation ( description: " The client should call the error handler for emit errors because of " +
360
375
" custom data " )
You can’t perform that action at this time.
0 commit comments