AppTests.swift 405 B

123456789101112131415
  1. @testable import App
  2. import XCTVapor
  3. final class AppTests: XCTestCase {
  4. func testHelloWorld() async throws {
  5. let app = Application(.testing)
  6. defer { app.shutdown() }
  7. try await configure(app)
  8. try app.test(.GET, "hello", afterResponse: { res in
  9. XCTAssertEqual(res.status, .ok)
  10. XCTAssertEqual(res.body.string, "Hello, world!")
  11. })
  12. }
  13. }