Skip to content

Commit

Permalink
better logging if test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Aug 20, 2024
1 parent 0c317ef commit 3c746f1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Tests/AppTests/AppTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ final class AppTests: XCTestCase {
let name = "ChairTest"
let url = LilliputExamples.urlForGame(named: name)!
let game = GameConfiguration(name: name, url: url, database: "test")
try configure(app, game: game)

try app.test(.GET, "/") { res in
XCTAssertEqual(res.status, .ok)
XCTAssertTrue(res.body.string.contains(game.name))
do {
try configure(app, game: game)
try app.test(.GET, "/game") { res in
XCTAssertEqual(res.status, .ok)
XCTAssertTrue(res.body.string.contains(game.name))
}
} catch {
print(String(reflecting: error))
throw error
}
}
}

0 comments on commit 3c746f1

Please sign in to comment.