Configure first WebSocket test

This commit is contained in:
Christoph Hagen
2022-01-23 20:49:06 +01:00
parent 8722d21e9b
commit 145f68268a
5 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,15 @@
@testable import App
import XCTVapor
final class AppTests: XCTestCase {
func testHelloWorld() throws {
let app = Application(.testing)
defer { app.shutdown() }
try configure(app)
try app.test(.GET, "hello", afterResponse: { res in
XCTAssertEqual(res.status, .ok)
XCTAssertEqual(res.body.string, "Hello, world!")
})
}
}