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:
@@ -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;
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user