Created
July 8, 2025 11:25
-
-
Save jacobsapps/50a0cb1be11ebe88bc4141299670d33a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func test_refresh_loadsDataFromAPI() { | |
// given | |
mockAPI.stubFetchResponse = .success([]) | |
let exp = expectation(description: #function) | |
// when | |
viewModel.refresh() | |
mockAPI.didFetchData = { exp.fulfill() } | |
// then | |
waitForExpectations(timeout: 1) | |
XCTAssertTrue(mockAPI.fetchDataCalled) // ✅ pass | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment