Skip to content

Commit

Permalink
Catch errors thrown during tests (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTim authored Oct 22, 2024
1 parent 1a6be9a commit 6695bd2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Tests/AppTests/AppTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ import Testing
struct AppTests {
private func withApp(_ test: (Application) async throws -> ()) async throws {
let app = try await Application.make(.testing)
try await configure(app)
{{#fluent}}try await app.autoMigrate()
{{/fluent}} try await test(app)
{{#fluent}}try await app.autoRevert()
{{/fluent}} try await app.asyncShutdown()
do {
try await configure(app)
{{#fluent}}try await app.autoMigrate()
{{/fluent}} try await test(app)
{{#fluent}}try await app.autoRevert()
{{/fluent}} }
catch {
try await app.asyncShutdown()
throw error
}
try await app.asyncShutdown()
}

@Test("Test Hello World Route")
Expand Down

0 comments on commit 6695bd2

Please sign in to comment.