Tweak some tests

This commit is contained in:
Erik 2017-07-06 12:56:02 -04:00
parent 407b5c644f
commit b62f69a0ca
No known key found for this signature in database
GPG Key ID: 4930B7C5FBC1A69D

View File

@ -238,23 +238,23 @@ class SocketSideEffectTest: XCTestCase {
socket.setTestStatus(.notConnected)
socket.on(clientEvent: .connect) {data, ack in
expect.fulfill()
}
socket.connect(timeoutAfter: 0.5, withHandler: {
XCTFail("Should not call timeout handler if status is connected")
})
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1) {
// Fake connecting
self.socket.setTestStatus(.connected)
}
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.7) {
expect.fulfill()
self.socket.parseEngineMessage("0/")
}
waitForExpectations(timeout: 2)
}
func testConnectIsCalledWithNamepsace() {
func testConnectIsCalledWithNamespace() {
let expect = expectation(description: "The client should not call the timeout function")
let nspString = "/swift"