@@ -203,7 +203,7 @@ import Vapor
203
203
#expect( v. resolvedDependencies == [ . init( packageName: " packageName " ,
204
204
repositoryURL: " repositoryURL " ) ] )
205
205
// build failed, hence no package platform compatibility yet
206
- let p = try await XCTUnwrapAsync ( try await Package . find ( p. id, on: app. db) )
206
+ let p = try #require ( try await Package . find ( p. id, on: app. db) )
207
207
#expect( p. platformCompatibility == [ ] )
208
208
} )
209
209
}
@@ -237,7 +237,7 @@ import Vapor
237
237
#expect( v. resolvedDependencies == [ . init( packageName: " foo " ,
238
238
repositoryURL: " http://foo/bar " ) ] )
239
239
// build ok now -> package is macos compatible
240
- let p = try await XCTUnwrapAsync ( try await Package . find ( p. id, on: app. db) )
240
+ let p = try #require ( try await Package . find ( p. id, on: app. db) )
241
241
#expect( p. platformCompatibility == [ . macOS] )
242
242
} )
243
243
}
@@ -262,7 +262,7 @@ import Vapor
262
262
let builds = try await Build . query ( on: app. db) . all ( )
263
263
#expect( Set ( builds. map ( \. id) ) == Set ( [ . id0, . id1] ) )
264
264
// additional ios build ok -> package is also ios compatible
265
- let p = try await XCTUnwrapAsync ( try await Package . find ( p. id, on: app. db) )
265
+ let p = try #require ( try await Package . find ( p. id, on: app. db) )
266
266
#expect( p. platformCompatibility == [ . iOS, . macOS] )
267
267
} )
268
268
}
@@ -376,10 +376,10 @@ import Vapor
376
376
" api/versions/ \( versionId) /build-report " ,
377
377
headers: . applicationJSON,
378
378
body: body,
379
- afterResponse: { res in
379
+ afterResponse: { res async throws in
380
380
// validation
381
381
#expect( res. status == . unauthorized)
382
- try await XCTAssertEqualAsync ( try await Build . query ( on: db) . count ( ) , 0 )
382
+ #expect ( try await Build . query ( on: db) . count ( ) == 0 )
383
383
}
384
384
)
385
385
@@ -389,10 +389,10 @@ import Vapor
389
389
" api/versions/ \( versionId) /build-report " ,
390
390
headers: . bearerApplicationJSON( " wrong " ) ,
391
391
body: body,
392
- afterResponse: { res in
392
+ afterResponse: { res async throws in
393
393
// validation
394
394
#expect( res. status == . unauthorized)
395
- try await XCTAssertEqualAsync ( try await Build . query ( on: db) . count ( ) , 0 )
395
+ #expect ( try await Build . query ( on: db) . count ( ) == 0 )
396
396
}
397
397
)
398
398
@@ -405,10 +405,10 @@ import Vapor
405
405
" api/versions/ \( versionId) /build-report " ,
406
406
headers: . bearerApplicationJSON( " secr3t " ) ,
407
407
body: body,
408
- afterResponse: { res in
408
+ afterResponse: { res async throws in
409
409
// validation
410
410
#expect( res. status == . unauthorized)
411
- try await XCTAssertEqualAsync ( try await Build . query ( on: db) . count ( ) , 0 )
411
+ #expect ( try await Build . query ( on: db) . count ( ) == 0 )
412
412
}
413
413
)
414
414
}
@@ -491,7 +491,7 @@ import Vapor
491
491
body: body,
492
492
afterResponse: { res async throws in
493
493
// validation
494
- let p = try await XCTUnwrapAsync ( await Package . find ( p. id, on: app. db) )
494
+ let p = try #require ( await Package . find ( p. id, on: app. db) )
495
495
#if os(Linux)
496
496
if p. updatedAt == originalPackageUpdate {
497
497
logWarning ( )
@@ -707,10 +707,10 @@ import Vapor
707
707
" api/builds/ \( buildId) /doc-report " ,
708
708
headers: . applicationJSON,
709
709
body: body,
710
- afterResponse: { res in
710
+ afterResponse: { res async throws in
711
711
// validation
712
712
#expect( res. status == . unauthorized)
713
- try await XCTAssertEqualAsync ( try await DocUpload . query ( on: app. db) . count ( ) , 0 )
713
+ #expect ( try await DocUpload . query ( on: app. db) . count ( ) == 0 )
714
714
}
715
715
)
716
716
@@ -720,10 +720,10 @@ import Vapor
720
720
" api/builds/ \( buildId) /doc-report " ,
721
721
headers: . bearerApplicationJSON( " wrong " ) ,
722
722
body: body,
723
- afterResponse: { res in
723
+ afterResponse: { res async throws in
724
724
// validation
725
725
#expect( res. status == . unauthorized)
726
- try await XCTAssertEqualAsync ( try await DocUpload . query ( on: app. db) . count ( ) , 0 )
726
+ #expect ( try await DocUpload . query ( on: app. db) . count ( ) == 0 )
727
727
}
728
728
)
729
729
@@ -736,10 +736,10 @@ import Vapor
736
736
" api/builds/ \( buildId) /doc-report " ,
737
737
headers: . bearerApplicationJSON( " secr3t " ) ,
738
738
body: body,
739
- afterResponse: { res in
739
+ afterResponse: { res async throws in
740
740
// validation
741
741
#expect( res. status == . unauthorized)
742
- try await XCTAssertEqualAsync ( try await DocUpload . query ( on: app. db) . count ( ) , 0 )
742
+ #expect ( try await DocUpload . query ( on: app. db) . count ( ) == 0 )
743
743
}
744
744
)
745
745
}
0 commit comments