This PR contains the work done to create a new *Hummingbird* project with very basic configuration from the _colibri_ executable, just like the project you could create with the [Hummingbird template](https://github.com/hummingbird-project/template) project in Github. Reviewed-on: #3 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
34 lines
734 B
Plaintext
34 lines
734 B
Plaintext
import AppLibrary
|
|
import Hummingbird
|
|
import HummingbirdTesting
|
|
import Testing
|
|
|
|
struct AppTests {
|
|
|
|
// MARK: Properties
|
|
|
|
private let arguments = TestArguments()
|
|
private let builder = AppBuilder(name: "App")
|
|
|
|
// 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: "")
|
|
}
|