Tweak some tests
This commit is contained in:
parent
407b5c644f
commit
b62f69a0ca
@ -238,23 +238,23 @@ class SocketSideEffectTest: XCTestCase {
|
|||||||
|
|
||||||
socket.setTestStatus(.notConnected)
|
socket.setTestStatus(.notConnected)
|
||||||
|
|
||||||
|
socket.on(clientEvent: .connect) {data, ack in
|
||||||
|
expect.fulfill()
|
||||||
|
}
|
||||||
|
|
||||||
socket.connect(timeoutAfter: 0.5, withHandler: {
|
socket.connect(timeoutAfter: 0.5, withHandler: {
|
||||||
XCTFail("Should not call timeout handler if status is connected")
|
XCTFail("Should not call timeout handler if status is connected")
|
||||||
})
|
})
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1) {
|
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1) {
|
||||||
// Fake connecting
|
// Fake connecting
|
||||||
self.socket.setTestStatus(.connected)
|
self.socket.parseEngineMessage("0/")
|
||||||
}
|
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.7) {
|
|
||||||
expect.fulfill()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
waitForExpectations(timeout: 2)
|
waitForExpectations(timeout: 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testConnectIsCalledWithNamepsace() {
|
func testConnectIsCalledWithNamespace() {
|
||||||
let expect = expectation(description: "The client should not call the timeout function")
|
let expect = expectation(description: "The client should not call the timeout function")
|
||||||
let nspString = "/swift"
|
let nspString = "/swift"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user