Skip to content

Commit 3c3174c

Browse files
committed
assert each sub-client inherits headers from supabase
1 parent 83016b7 commit 3c3174c

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Tests/SupabaseTests/SupabaseClientTests.swift

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
@testable import Auth
21
import CustomDump
3-
@testable import Functions
2+
import InlineSnapshotTesting
43
import IssueReporting
4+
import SnapshotTestingCustomDump
5+
import XCTest
6+
7+
@testable import Auth
8+
@testable import Functions
59
@testable import Realtime
610
@testable import Supabase
7-
import XCTest
8-
import InlineSnapshotTesting
9-
import SnapshotTestingCustomDump
1011

1112
final class AuthLocalStorageMock: AuthLocalStorage {
1213
func store(key _: String, value _: Data) throws {}
@@ -75,6 +76,10 @@ final class SupabaseClientTests: XCTestCase {
7576
]
7677
"""
7778
}
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)
7883

7984
XCTAssertEqual(client.functions.region, "ap-northeast-1")
8085

@@ -83,7 +88,8 @@ final class SupabaseClientTests: XCTestCase {
8388

8489
let realtimeOptions = client.realtimeV2.options
8590
let expectedRealtimeHeader = client._headers.merging(with: [
86-
.init("custom_realtime_header_key")!: "custom_realtime_header_value"]
91+
.init("custom_realtime_header_key")!: "custom_realtime_header_value"
92+
]
8793
)
8894
expectNoDifference(realtimeOptions.headers, expectedRealtimeHeader)
8995
XCTAssertIdentical(realtimeOptions.logger as? Logger, logger)

0 commit comments

Comments
 (0)