1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 04:20:05 +00:00

fix(*): handled 404s, set correct accept headers

This commit is contained in:
Krishna Acondy
2021-01-28 19:25:23 +00:00
parent 23d151c919
commit 3c894c4147
6 changed files with 29 additions and 29 deletions

View File

@@ -26,26 +26,20 @@ export const sasjsRequestTests = (adapter: SASjs): TestSuite => ({
description:
"Should make an error and capture log, in the same time it is testing if debug override is working",
test: async () => {
return new Promise(async (resolve, reject) => {
adapter
.request("common/makeErr", data, { debug: true })
.then((res) => {
//no action here, this request must throw error
})
.catch((err) => {
let sasRequests = adapter.getSasRequests();
let makeErrRequest: any =
sasRequests.find((req) =>
req.serviceLink.includes("makeErr")
) || null;
return adapter
.request("common/makeErr", data, { debug: true })
.catch((err) => {
let sasRequests = adapter.getSasRequests();
let makeErrRequest: any =
sasRequests.find((req) => req.serviceLink.includes("makeErr")) ||
null;
if (!makeErrRequest) return resolve(false);
if (!makeErrRequest) return false;
return resolve(
!!(makeErrRequest.logFile && makeErrRequest.logFile.length > 0)
);
});
});
return !!(
makeErrRequest.logFile && makeErrRequest.logFile.length > 0
);
});
},
assertion: (response) => {
return response;