Explicitly flag if aborting a request fails due to request completing

This commit is contained in:
Robin North
2018-01-24 23:20:36 +00:00
parent f7f68b2e50
commit 137322543c

View File

@@ -23,7 +23,9 @@ tape("test aborting xhr request", function(t) {
}) })
t.test("- pending request is aborted", function(t) { t.test("- pending request is aborted", function(t) {
var r = requestCacheBust("https://httpbin.org/delay/10", {}, function() {}) var r = requestCacheBust("https://httpbin.org/delay/10", {}, function() {
t.fail("xhr was not aborted")
})
t.equal(r.readyState, 1, "xhr readyState is '1' (SENT)") t.equal(r.readyState, 1, "xhr readyState is '1' (SENT)")
abortRequest(r) abortRequest(r)
t.equal(r.readyState, 0, "xhr readyState is '0' (ABORTED)") t.equal(r.readyState, 0, "xhr readyState is '0' (ABORTED)")