         pongExpectation = XCTestExpectation(description: "pongExpectation")
         socket.connect()
         socket.ping()
-        wait(for: [pongExpectation], timeout: Self.expectationTimeout)
+        wait(for: [pongExpectation!], timeout: Self.expectationTimeout)
+    }
+
+    func testPingsWithInterval() {
+        pingsWithIntervalExpectation = XCTestExpectation(description: "pingsWithIntervalExpectation")
+        socket.connect()
+        socket.ping(interval: Self.repeatedPingInterval)
+        wait(for: [pingsWithIntervalExpectation!], timeout: Self.expectationTimeout)
     }
 
     func testReceiveError() {

    }

    var shouldDisconnectImmediately: Bool!
    static let expectationTimeout = 5.0

    override func setUp() {
        super.setUp()

            shouldDisconnectImmediately = false
        }
    }
    var pongExpectation: XCTestExpectation? {
        didSet {
            shouldDisconnectImmediately = false
        }
    }
    var pingsWithIntervalExpectation: XCTestExpectation? {
        didSet {
            shouldDisconnectImmediately = false
        }
