Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import AppLibrary
|
||||
import Hummingbird
|
||||
import HummingbirdTesting
|
||||
import Testing
|
||||
|
||||
struct AppTests {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
private let arguments = TestArguments()
|
||||
private let builder = AppBuilder(name: "DocCRepo")
|
||||
|
||||
// MARK: Route tests
|
||||
|
||||
@Test(arguments: ["/"])
|
||||
func routes(_ uri: String) async throws {
|
||||
let app = try await builder(arguments)
|
||||
|
||||
try await app.test(.router) { client in
|
||||
try await client.execute(uri: uri, method: .get) { response in
|
||||
#expect(response.status == .ok)
|
||||
#expect(response.body == .empty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: ByteBuffer+Constants
|
||||
|
||||
private extension ByteBuffer {
|
||||
static let empty = ByteBuffer(string: "")
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import AppLibrary
|
||||
import Logging
|
||||
|
||||
struct TestArguments: AppArguments {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
let hostname = "127.0.0.1"
|
||||
let port = 0
|
||||
let logLevel: Logger.Level? = .trace
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user