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

test: requests for every approach

This commit is contained in:
2021-07-26 14:52:26 +02:00
parent c8fb141048
commit 890608a3e8
2 changed files with 68 additions and 4 deletions

View File

@@ -145,6 +145,52 @@ export const basicTests = (
sasjsConfig.debug === false
)
}
},
{
title: 'Compute API request',
description: 'Should run the request with compute API approach',
test: async () => {
if (adapter.getSasjsConfig().serverType !== 'SASVIYA')
return Promise.resolve('skip')
return await adapter.request('common/sendArr', stringData)
},
assertion: (response: any) => {
if (response === 'skip') return true
return response.table1[0][0] === stringData.table1[0].col1
}
},
{
title: 'JES API request',
description: 'Should run the request with JES API approach',
test: async () => {
if (adapter.getSasjsConfig().serverType !== 'SASVIYA')
return Promise.resolve('skip')
const config = {
useComputeApi: false
}
return await adapter.request('common/sendArr', stringData, config)
},
assertion: (response: any) => {
if (response === 'skip') return true
return response.table1[0][0] === stringData.table1[0].col1
}
},
{
title: 'Web request',
description: 'Should run the request with old web approach',
test: async () => {
const config = {
useComputeApi: null
}
return await adapter.request('common/sendArr', stringData, config)
},
assertion: (response: any) => {
return response.table1[0][0] === stringData.table1[0].col1
}
}
]
})