From 2b5a22c13207232fd39834c3eb203a0516f986b8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 11 Dec 2020 02:04:48 -0500 Subject: [PATCH] Add additional checks to test for HTTP.request() 5xx retry --- test/tests/httpTest.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/tests/httpTest.js b/test/tests/httpTest.js index 7dc327363b..84a7e4e066 100644 --- a/test/tests/httpTest.js +++ b/test/tests/httpTest.js @@ -157,13 +157,16 @@ describe("Zotero.HTTP", function () { "GET", baseURL + "error", { - errorDelayIntervals: [10, 20], - errorDelayMax: 25 + errorDelayIntervals: [10, 20, 100], + errorDelayMax: 35 } ) ); 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 () {