Skip to content

Commit

Permalink
fix: test that timer is not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg committed Jan 24, 2025
1 parent 6cca126 commit 24032bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tests/UnleashProxyClientSwiftTests/PollerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ final class PollerTests: XCTestCase {
XCTAssertEqual(poller.getFeature(name: "Bar"), stubToggles.last!)
}

func testTimerNotInitializedWhenRefreshIntervalIsZero() {
let poller = Poller(
refreshInterval: 0,
unleashUrl: unleashUrl,
apiKey: apiKey,
session: MockPollerSession()
)

XCTAssertNil(poller.timer, "Timer should not be initialized when refreshInterval is zero")
}

private func createPoller(
with session: PollerSession,
url: URL? = nil,
Expand Down

0 comments on commit 24032bf

Please sign in to comment.