我的单元测试用例失败
waitForExpectations(timeout: 50, handler: nil)
有错误
异步等待失败:超出50秒超时,未满足期望:
func testThatItSummery() {
let expectation = self.expectation(description: "GET SUMMERY")
Request.jobSummary(startDate: startDateStr, endDate: endDateStr).execute().fetchResponseJSON({(_, _, json, error) in
if error != nil {
NSLog("Response error:\(error)")
XCTAssertNotNil(error, "JobSummary Response error")
expectation.fulfill()
} else {
let jobSummaryJson = json["job"]
XCTAssertNotNil(json, "JobSummary Response")
expectation.fulfill()
}
})
waitForExpectations(timeout: 50, handler: nil)
}
}