File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,21 @@ class SocketSideEffectTest: XCTestCase {
355355 waitForExpectations ( timeout: 2 )
356356 }
357357
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+
358373 func testErrorInCustomSocketDataCallsErrorHandler( ) {
359374 let expect = expectation ( description: " The client should call the error handler for emit errors because of " +
360375 " custom data " )
You can’t perform that action at this time.
0 commit comments