Moved test database teardown into defer blocks and unified the one-decimal formatting in the Website service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javierandClaude Opus 5.5 committed 2026-10-25 12:41:55 +01:00
1 parent 06953a1be0
commit e0524da525
16 files changed
+118 -146

No files matched your search

@@ -156,27 +156,23 @@ private extension PasskeyControllerTests {
logger: Logger(label: "test")
)()
do {
await PrepareDB()(for: fluent)
try await fluent.migrate()
let router = Router(context: WebsiteRequestContext.self)
router.addRoutes(PasskeyController<WebsiteRequestContext>(
origin: "http://localhost:8080",
accounts: .init(fluent: fluent),
sessions: .init()
).routes)
try await Application(router: router).test(.router, body)
} catch {
defer {
try? await fluent.shutdown()
throw error
}
try await fluent.shutdown()
await PrepareDB()(for: fluent)
try await fluent.migrate()
let router = Router(context: WebsiteRequestContext.self)
router.addRoutes(PasskeyController<WebsiteRequestContext>(
origin: "http://localhost:8080",
accounts: .init(fluent: fluent),
sessions: .init()
).routes)
try await Application(router: router).test(.router, body)
}
}