您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

16 行
405 B

  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. }