File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,11 @@ class PackageCollectionControllerTests: AppTestCase {
58
58
summary: " summary 1 " ) . create ( on: app. db)
59
59
60
60
// MUT
61
+ let encoder = self . encoder
61
62
try await app. test (
62
63
. GET,
63
64
" foo/collection.json " ,
64
- afterResponse: { res async throws in
65
+ afterResponse: { @ MainActor res async throws in
65
66
// validation
66
67
XCTAssertEqual ( res. status, . ok)
67
68
let json = try res. content. decode ( PackageCollection . self)
Original file line number Diff line number Diff line change @@ -370,8 +370,13 @@ class PackageCollectionTests: AppTestCase {
370
370
keywords: [ " key " , " word " ] ,
371
371
overview: " overview " )
372
372
373
- // validate
373
+ #if compiler(<6)
374
+ await MainActor . run { // validate
375
+ assertSnapshot ( of: res, as: . json( encoder) )
376
+ }
377
+ #else
374
378
assertSnapshot ( of: res, as: . json( encoder) )
379
+ #endif
375
380
}
376
381
377
382
func test_generate_from_urls_noResults( ) async throws {
@@ -467,8 +472,13 @@ class PackageCollectionTests: AppTestCase {
467
472
authorName: " Foo " ,
468
473
keywords: [ " key " , " word " ] )
469
474
470
- // validate
475
+ #if compiler(<6)
476
+ await MainActor . run { // validate
477
+ assertSnapshot ( of: res, as: . json( encoder) )
478
+ }
479
+ #else
471
480
assertSnapshot ( of: res, as: . json( encoder) )
481
+ #endif
472
482
}
473
483
474
484
func test_generate_for_owner_noResults( ) async throws {
@@ -768,7 +778,13 @@ class PackageCollectionTests: AppTestCase {
768
778
769
779
// validate signed collection content
770
780
XCTAssertFalse ( signedCollection. signature. signature. isEmpty)
781
+ #if compiler(<6)
782
+ await MainActor . run {
783
+ assertSnapshot ( of: signedCollection, as: . json( encoder) )
784
+ }
785
+ #else
771
786
assertSnapshot ( of: signedCollection, as: . json( encoder) )
787
+ #endif
772
788
773
789
// validate signature
774
790
let validated = try await SignedCollection . validate ( signedCollection: signedCollection)
You can’t perform that action at this time.
0 commit comments