1
- @testable import Auth
2
1
import CustomDump
3
- @ testable import Functions
2
+ import InlineSnapshotTesting
4
3
import IssueReporting
4
+ import SnapshotTestingCustomDump
5
+ import XCTest
6
+
7
+ @testable import Auth
8
+ @testable import Functions
5
9
@testable import Realtime
6
10
@testable import Supabase
7
- import XCTest
8
11
9
12
final class AuthLocalStorageMock : AuthLocalStorage {
10
13
func store( key _: String , value _: Data ) throws { }
@@ -61,16 +64,22 @@ final class SupabaseClientTests: XCTestCase {
61
64
" https://project-ref.supabase.co/functions/v1 "
62
65
)
63
66
64
- XCTAssertEqual (
65
- client . headers ,
67
+ assertInlineSnapshot ( of : client . headers , as : . customDump ) {
68
+ """
66
69
[
67
- " X-Client-Info " : " supabase-swift/ \( Supabase . version) " ,
68
70
" Apikey " : " ANON_KEY " ,
69
- " header_field " : " header_value " ,
70
71
" Authorization " : " Bearer ANON_KEY " ,
72
+ " X-Client-Info " : " supabase-swift/0.0.0 " ,
73
+ " X-Supabase-Client-Platform " : " macOS " ,
74
+ " X-Supabase-Client-Platform-Version " : " 0.0.0 " ,
75
+ " header_field " : " header_value "
71
76
]
72
- )
73
- expectNoDifference ( client. _headers. dictionary, client. headers)
77
+ """
78
+ }
79
+ expectNoDifference ( client. headers, client. auth. configuration. headers)
80
+ expectNoDifference ( client. headers, client. functions. headers. dictionary)
81
+ expectNoDifference ( client. headers, client. storage. configuration. headers)
82
+ expectNoDifference ( client. headers, client. rest. configuration. headers)
74
83
75
84
XCTAssertEqual ( client. functions. region, " ap-northeast-1 " )
76
85
@@ -79,7 +88,8 @@ final class SupabaseClientTests: XCTestCase {
79
88
80
89
let realtimeOptions = client. realtimeV2. options
81
90
let expectedRealtimeHeader = client. _headers. merging ( with: [
82
- . init( " custom_realtime_header_key " ) !: " custom_realtime_header_value " ]
91
+ . init( " custom_realtime_header_key " ) !: " custom_realtime_header_value "
92
+ ]
83
93
)
84
94
expectNoDifference ( realtimeOptions. headers, expectedRealtimeHeader)
85
95
XCTAssertIdentical ( realtimeOptions. logger as? Logger , logger)
0 commit comments