From 11746c61bd2f289b107c0e82107a9b228f10adbe Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 15 Oct 2020 18:46:21 +0000 Subject: [PATCH] fix(core): update --- test/test.ts | 4 ++-- ts/index.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test.ts b/test/test.ts index 1a8484f..11a134d 100644 --- a/test/test.ts +++ b/test/test.ts @@ -52,8 +52,8 @@ tap.test('first test', async (tools) => { const response2 = await new webrequest.WebRequest().getJson('http://localhost:2345/apiroute3'); - console.log(response); - console.log(response2); + console.log('response 1: ' + JSON.stringify(response)); + console.log('response 2: ' + JSON.stringify(response2)); expect(response).property('hithere').to.equal('hi'); expect(response2).property('hithere').to.equal('hi'); diff --git a/ts/index.ts b/ts/index.ts index 0c7924a..9fa1004 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -123,9 +123,11 @@ export class WebRequest { if (response.status >= 200 && response.status < 300) { return response; } else { + // lets perform a history check to determine failed urls await doHistoryCheck(response.status.toString()); - // tslint:disable-next-line: no-return-await - return await doRequest(allUrls[usedUrlIndex]); + // lets fire the request + const result = await doRequest(allUrls[usedUrlIndex]); + return result; } };