You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
case .startTimer: return .run { send in for await _ in self.clock.timer(interval: .seconds(1)) { await send(.timerTick) } } .cancellable(id: CancelID.warmupTimer)
this action which causes that issue. this is how my test looks like
@Test("Timer started 30 seconds ago, the last one was skipped") func syncRunningInfoFullPath() async throws { let clock = TestClock() let thirtySecondsAgo = Date().addingTimeInterval(-30) $mtisCampaignRunningData.withLock { $0 = .init(timerStartTime: thirtySecondsAgo, lastSkipped: true) } let store = await TestStore(initialState: MountainWaterDashboard.State()) { MountainWaterDashboard() } store.exhaustivity = .off await withDependencies { $0.continuousClock = clock } operation: { await store.send(.syncRunningInfo) { $0.shouldPresentSuccessToast = true $0.dashboardState = .warmup $0.secondsToWarmupRemaining = $0.secondsToWarmup - 30 $0.$mtisCampaignRunningData.withLock { $0?.lastSkipped = false } } await store.receive(\.startTimer) await store.finish() } }
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having issues testing an action that uses the continuousClock dependency.
This is the action I'm trying to test:
This action optionally triggers:
this action which causes that issue.
this is how my test looks like
what am I missing?
Beta Was this translation helpful? Give feedback.
All reactions