Skip to content

Commit

Permalink
Merge pull request #220 from klaviyo/ndurell-patch-1-revisions
Browse files Browse the repository at this point in the history
removed cleanup methods
  • Loading branch information
ab1470 authored Oct 16, 2024
2 parents 302779b + c25df4c commit c960f1e
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions Tests/KlaviyoSwiftTests/APIRequestErrorHandlingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
@MainActor
override func setUp() async throws {
environment = KlaviyoEnvironment.test()
klaviyoSwiftEnvironment = KlaviyoSwiftEnvironment.test()
}

func cleanup(testStore: TestStore<KlaviyoReducer.State, KlaviyoReducer.Action, KlaviyoReducer.State, KlaviyoReducer.Action, Void>) async {
// await testStore.send(.stop)
// await testStore.receive(.cancelInFlightRequests)
await testStore.finish()
}

// MARK: - http error
Expand All @@ -42,8 +35,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.flushing = false
$0.requestsInFlight = []
}

await cleanup(testStore: store)
}

@MainActor
Expand All @@ -67,8 +58,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

@MainActor
Expand All @@ -92,7 +81,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}
await cleanup(testStore: store)
}

// MARK: - network error
Expand All @@ -115,8 +103,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(2)
}

await cleanup(testStore: store)
}

@MainActor
Expand All @@ -138,8 +124,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(2)
}

await cleanup(testStore: store)
}

@MainActor
Expand All @@ -163,8 +147,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

// MARK: - internal error
Expand All @@ -188,8 +170,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

// MARK: - internal request error
Expand All @@ -212,8 +192,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

// MARK: - unknown error
Expand All @@ -236,8 +214,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

// MARK: - data decoding error
Expand All @@ -259,8 +235,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

// MARK: - invalid data
Expand All @@ -282,8 +256,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}

// MARK: - rate limit error
Expand All @@ -305,8 +277,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retryWithBackoff(requestCount: 2, totalRetryCount: 2, currentBackoff: 30)
}

await cleanup(testStore: store)
}

@MainActor
Expand All @@ -327,11 +297,8 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retryWithBackoff(requestCount: 3, totalRetryCount: 3, currentBackoff: 30)
}

await cleanup(testStore: store)
}

@MainActor
func testRetryWithRetryAfter() async throws {
var initialState = INITIALIZED_TEST_STATE()
initialState.retryInfo = .retryWithBackoff(requestCount: 3, totalRetryCount: 3, currentBackoff: 4)
Expand All @@ -349,8 +316,6 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retryWithBackoff(requestCount: 4, totalRetryCount: 4, currentBackoff: 20)
}

await cleanup(testStore: store)
}

// MARK: - Missing or invalid response
Expand All @@ -373,7 +338,5 @@ class APIRequestErrorHandlingTests: XCTestCase {
$0.requestsInFlight = []
$0.retryInfo = .retry(1)
}

await cleanup(testStore: store)
}
}

0 comments on commit c960f1e

Please sign in to comment.