mirror of
https://github.com/sasjs/adapter.git
synced 2026-07-24 15:12:15 +00:00
fix(debug): add viya debug log parser - parse JSON from inline blob with webout
This commit is contained in:
@@ -31,6 +31,20 @@ var blob = new Blob([\`{"SYSDATE" : "13MAY26"
|
||||
expect(result).toEqual(resultData)
|
||||
})
|
||||
|
||||
it('should extract and parse JSON wrapped in weboutBEGIN/END (text/plain blob)', async () => {
|
||||
const resultData = { SYSCC: '1012', SYSERRORTEXT: 'File missing.' }
|
||||
const response = `<script>
|
||||
var blob = new Blob([\`>>weboutBEGIN<<
|
||||
${JSON.stringify(resultData)}
|
||||
>>weboutEND<<
|
||||
\`], {type: 'text/plain'});
|
||||
</script>`
|
||||
|
||||
const result = await parseSasViyaLogDebugResponse(response)
|
||||
|
||||
expect(result).toEqual(resultData)
|
||||
})
|
||||
|
||||
it('should throw an error if blob is not found', async () => {
|
||||
const response = `<html><body>No blob here</body></html>`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user