Add additional checks to test for HTTP.request() 5xx retry
This commit is contained in:
parent
87352822fa
commit
2b5a22c132
1 changed files with 6 additions and 3 deletions
|
@ -157,13 +157,16 @@ describe("Zotero.HTTP", function () {
|
||||||
"GET",
|
"GET",
|
||||||
baseURL + "error",
|
baseURL + "error",
|
||||||
{
|
{
|
||||||
errorDelayIntervals: [10, 20],
|
errorDelayIntervals: [10, 20, 100],
|
||||||
errorDelayMax: 25
|
errorDelayMax: 35
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
assert.instanceOf(e, Zotero.HTTP.UnexpectedStatusException);
|
assert.instanceOf(e, Zotero.HTTP.UnexpectedStatusException);
|
||||||
assert.isTrue(spy.calledTwice);
|
assert.isTrue(spy.calledThrice);
|
||||||
|
assert.isTrue(delayStub.calledTwice);
|
||||||
|
assert.equal(delayStub.args[0][0], 10);
|
||||||
|
assert.equal(delayStub.args[1][0], 20);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should provide cancellerReceiver a callback to cancel while waiting to retry a 5xx error", async function () {
|
it("should provide cancellerReceiver a callback to cancel while waiting to retry a 5xx error", async function () {
|
||||||
|
|
Loading…
Reference in a new issue