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

fix: log capture if job fails, test framework update, added test for log capture

This commit is contained in:
Mihajlo Medjedovic
2020-08-18 17:36:25 +02:00
parent ea0f338b90
commit fb727788d0
5 changed files with 58 additions and 32 deletions

View File

@@ -21,5 +21,26 @@ export const sasjsRequestTests = (adapter: SASjs): TestSuite => ({
}
},
},
{
title: "Make error and capture log",
description: "Should make an error and capture log",
test: async () => {
return new Promise( async (resolve, reject) => {
adapter.request("common/makeErr", data)
.then((res) => {
//no action here, this request must throw error
})
.catch((err) => {
let sasRequests = adapter.getSasRequests();
let makeErrRequest = sasRequests.find(req => req.serviceLink.includes('makeErr')) || null;
resolve(!!makeErrRequest);
})
})
},
assertion: (response) => {
return response;
},
},
],
});