Skip to content

Commit 85a9de0

Browse files
committed
fix: 배지 테스트 spy 동기화 처리
1 parent 9ea012e commit 85a9de0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Application/DevLogPresentation/Tests/Root/RootFeatureTestSupport.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Combine
99
import ComposableArchitecture
1010
import DevLogCore
1111
import DevLogDomain
12+
import Foundation
1213
import Testing
1314
@testable import DevLogPresentation
1415

@@ -299,9 +300,18 @@ final class RootTrackAnalyticsEventUseCaseSpy: TrackAnalyticsEventUseCase {
299300
}
300301

301302
final class RootApplicationBadgeCountSpy: @unchecked Sendable {
302-
private(set) var counts = [Int]()
303+
private let lock = NSLock()
304+
private var protectedCounts = [Int]()
305+
306+
var counts: [Int] {
307+
lock.withLock {
308+
protectedCounts
309+
}
310+
}
303311

304312
func setBadgeCount(_ count: Int) async throws {
305-
counts.append(count)
313+
lock.withLock {
314+
protectedCounts.append(count)
315+
}
306316
}
307317
}

0 commit comments

Comments
 (0)