fix test codes
This commit is contained in:
parent
9c6fa61af9
commit
4a80ea5370
|
@ -0,0 +1,3 @@
|
|||
import Foundation
|
||||
|
||||
let timeoutInterval: TimeInterval = 20
|
|
@ -25,7 +25,7 @@ extension XCTestCase {
|
|||
entity = response
|
||||
}
|
||||
|
||||
wait(for: [exp], timeout: 10)
|
||||
waitForExpectations(timeout: timeoutInterval)
|
||||
return entity
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ extension XCTestCase {
|
|||
},
|
||||
to: "https://localhost/upload"
|
||||
).responseJSON { _ in exp.fulfill() }
|
||||
wait(for: [exp], timeout: 10)
|
||||
waitForExpectations(timeout: timeoutInterval)
|
||||
let response = try XCTUnwrap(request.response, file: file, line: line)
|
||||
XCTAssertEqual(response.statusCode, 200, file: file, line: line)
|
||||
guard let data = request.data else { return nil }
|
||||
|
|
|
@ -32,7 +32,7 @@ extension XCTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
wait(for: [exp], timeout: 10)
|
||||
waitForExpectations(timeout: timeoutInterval)
|
||||
return entity
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ extension XCTestCase {
|
|||
entity = try? data.flatMap { try JSONDecoder().decode(TestEntity.self, from: $0) }
|
||||
}.resume()
|
||||
|
||||
wait(for: [exp], timeout: 10)
|
||||
waitForExpectations(timeout: timeoutInterval)
|
||||
return entity
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ extension XCTestCase {
|
|||
entity = try? data.flatMap { try JSONDecoder().decode(TestEntity.self, from: $0) }
|
||||
}.resume()
|
||||
|
||||
wait(for: [exp], timeout: 10)
|
||||
waitForExpectations(timeout: timeoutInterval)
|
||||
return entity
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue