Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 20c7421

Browse files
committedDec 30, 2019
feat: add test testConnectedAlready
1 parent 07a6029 commit 20c7421

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎Tests/TestSocketIO/SocketSideEffectTest.swift

+13
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,19 @@ 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+
361+
socket.setTestStatus(.connected)
362+
manager.engine = TestEngine(client: manager, url: manager.socketURL, options: nil)
363+
364+
socket.connect(timeoutAfter: 0.5, withHandler: {
365+
expect.fulfill()
366+
})
367+
368+
waitForExpectations(timeout: 0.8)
369+
}
370+
358371
func testErrorInCustomSocketDataCallsErrorHandler() {
359372
let expect = expectation(description: "The client should call the error handler for emit errors because of " +
360373
"custom data")

0 commit comments

Comments
 (0)
Please sign in to comment.