Skip to content

Socket Connection Tests Always Success #64

@eridbardhaj

Description

@eridbardhaj
- (void)testConnectToLocalhost {
    XCTestExpectation *connectionExpectation = [self expectationWithDescription: @"should connect to localhost"];
    [SIOSocket socketWithHost: @"ws://sdfsdf" response: ^(SIOSocket *socket) {
        XCTAssertNotNil(socket, @"socket could not connect to localhost");
        [connectionExpectation fulfill];
    }];

    [self waitForExpectationsWithTimeout: 10 handler: nil];
}

For any host this Socket will say that the connection is opened. Is there any reason why? Because I want to know if I can reach a specific WebSocket server, and this was the way that I was introduced to in Tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions