Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgardo committed Apr 23, 2024
1 parent 056f621 commit dac9901
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tests/VaporTests/ServerTests.swift
Expand Up @@ -1409,6 +1409,16 @@ final class ServerTests: XCTestCase {
}
}

func testConfigurationHasActualPortAfterStart() throws {
let app = Application(.testing)
app.http.server.configuration.port = 0
defer { app.shutdown() }
try app.start()

XCTAssertNotEqual(app.http.server.configuration.port, 0)
XCTAssertEqual(app.http.server.configuration.port, app.http.server.shared.localAddress?.port)
}

override class func setUp() {
XCTAssertTrue(isLoggingConfigured)
}
Expand Down

0 comments on commit dac9901

Please sign in to comment.