fpg1503 / asynchronous Goto Github PK
View Code? Open in Web Editor NEWImplementation-agnostic asynchronous code
License: MIT License
Implementation-agnostic asynchronous code
License: MIT License
Hey!
I was showing your project to my team and I found some failing tests.
So, I cloned the project and ran the tests and some tests on AlamofireAsyncTests
failed.
I notice that the failing tests are those that check for failing responses, with the message saying that expect TestError
but got nil
instead.
I tried to fix it with the code below
let testError = NSError(domain: "AsynchronousTests", code: 0, userInfo: nil)
func testDataRequestResponseFailure() {
let expected = testError
stub(everything, failure(expected as NSError))
wait { expectation in
Alamofire.request(fakeURL).response().async { result in
switch result {
case .success(let (_, _, value)):
XCTFail("Unexpected value \(value)")
case .failure(let actual):
XCTAssertEqual(expected, actual.error as NSError)
}
expectation.fulfill()
}
}
}
but got this error
XCTAssertEqual failed: ("Error Domain=AsynchronousTests Code=0 "(null)"") is not equal to ("Error Domain=AsynchronousTests Code=0 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <0063E615-BE9B-4022-AC07-1F06C14BDF97>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0063E615-BE9B-4022-AC07-1F06C14BDF97>.<1>}")
So I think Mockingjay
is returning another error or something like this. I looked at Mockingjay
tests and here they are just verifying the error's domain.
Should we do the same maybe?
Also, I tried calling super.setUp
here but the results were the same.
I running with this environment
Xcode 11.2.1
Build version 11B500
Could you please take a look at this?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.