@@ -1337,31 +1337,33 @@ class PackageController_routesTests: SnapshotTestCase {
13371337
13381338 func test_siteMap_prod( ) async throws {
13391339 // Ensure sitemap routing is configured in prod
1340- // Setup
1341- Current . environment = { . production }
1342- // We also need to set up a new app that's configured for production,
1343- // because app.test is not affected by Current overrides.
1344- let prodApp = try await setup ( . production)
1340+ try await withDependencies {
1341+ $0. environment. current = { . production }
1342+ } operation: {
1343+ // We also need to set up a new app that's configured for production,
1344+ // because app.test is not affected by @Dependency overrides.
1345+ let prodApp = try await setup ( . production)
13451346
1346- do {
1347- // setup
1348- let package = Package ( url: URL ( stringLiteral: " https://example.com/owner/repo0 " ) )
1349- try await package . save ( on: app. db)
1350- try await Repository ( package : package , defaultBranch: " default " ,
1351- lastCommitDate: Date . now,
1352- name: " Repo0 " , owner: " Owner " ) . save ( on: app. db)
1353- try await Version ( package : package , latest: . defaultBranch, packageName: " SomePackage " ,
1354- reference: . branch( " default " ) ) . save ( on: app. db)
1355-
1356- // MUT
1357- try await prodApp. test ( . GET, " /owner/repo0/sitemap.xml " ) { res async in
1358- XCTAssertEqual ( res. status, . ok)
1347+ do {
1348+ // setup
1349+ let package = Package ( url: URL ( stringLiteral: " https://example.com/owner/repo0 " ) )
1350+ try await package . save ( on: app. db)
1351+ try await Repository ( package : package , defaultBranch: " default " ,
1352+ lastCommitDate: Date . now,
1353+ name: " Repo0 " , owner: " Owner " ) . save ( on: app. db)
1354+ try await Version ( package : package , latest: . defaultBranch, packageName: " SomePackage " ,
1355+ reference: . branch( " default " ) ) . save ( on: app. db)
1356+
1357+ // MUT
1358+ try await prodApp. test ( . GET, " /owner/repo0/sitemap.xml " ) { res async in
1359+ XCTAssertEqual ( res. status, . ok)
1360+ }
1361+ } catch {
1362+ try ? await prodApp. asyncShutdown ( )
1363+ throw error
13591364 }
1360- } catch {
1361- try ? await prodApp. asyncShutdown ( )
1362- throw error
1365+ try await prodApp. asyncShutdown ( )
13631366 }
1364- try await prodApp. asyncShutdown ( )
13651367 }
13661368
13671369 func test_siteMap_dev( ) async throws {
0 commit comments