Skip to content

Commit

Permalink
fix: Fix test testResolveAndApplyIntegerFlagError
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziodemaria committed Apr 30, 2024
1 parent 3bdebd1 commit 7a1929a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class ConfidenceFeatureProviderTest: XCTestCase {
}

func testResolveAndApplyIntegerFlagError() throws {
flagApplier = FlagApplierMock(expectedApplies: 2)
let resolve: [String: MockedResolveClientURLProtocol.ResolvedTestFlag] = [
"user1": .init(variant: "control", value: .structure(["size": .integer(3)]))
]
Expand Down
4 changes: 4 additions & 0 deletions Tests/ConfidenceProviderTests/Helpers/FlagApplierMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class FlagApplierMock: FlagApplier {
var applyCallCount = 0
var applyExpectation = XCTestExpectation(description: "Flag Applied")

init(expectedApplies: Int = 1) {
applyExpectation.expectedFulfillmentCount = expectedApplies
}

func apply(flagName: String, resolveToken: String) async {
applyCallCount += 1
applyExpectation.fulfill()
Expand Down

0 comments on commit 7a1929a

Please sign in to comment.