Skip to content

Commit

Permalink
udpate test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MacOMNI committed Nov 4, 2024
1 parent 8ce22a8 commit f0e1b04
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Networking/Tests/NetworkingTests/MockPeerEventTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ final class MockPeerEventTests {
configuration: clientConfiguration
)

// Attempt to connect
try clientConnection.connect(to: listenAddress)
try? await Task.sleep(for: .milliseconds(200))
#expect(throws: Error.self) {
try? await Task.sleep(for: .milliseconds(100))
await #expect(throws: Error.self) {
try clientConnection.connect(to: listenAddress)
try? await Task.sleep(for: .milliseconds(200))
let stream1 = try clientConnection.createStream()
try stream1.send(data: Data("test data 1".utf8))
}
Expand Down Expand Up @@ -253,11 +253,10 @@ final class MockPeerEventTests {
registration: registration,
configuration: clientConfiguration
)

// Attempt to connect
try clientConnection.connect(to: listenAddress)
try? await Task.sleep(for: .milliseconds(200))
#expect(throws: Error.self) {
try? await Task.sleep(for: .milliseconds(100))
await #expect(throws: Error.self) {
try clientConnection.connect(to: listenAddress)
try? await Task.sleep(for: .milliseconds(200))
let stream1 = try clientConnection.createStream()
try stream1.send(data: Data("test data 1".utf8))
}
Expand Down

0 comments on commit f0e1b04

Please sign in to comment.