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

test: cypress running with debug on and off, testing all request approaches

This commit is contained in:
2021-07-26 19:16:47 +02:00
parent 890608a3e8
commit cf10e83e91
3 changed files with 55 additions and 34 deletions

View File

@@ -146,44 +146,12 @@ export const basicTests = (
)
}
},
{
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
useComputeApi: undefined
}
return await adapter.request('common/sendArr', stringData, config)

View File

@@ -1,9 +1,35 @@
import SASjs from '@sasjs/adapter'
import { TestSuite } from '@sasjs/test-framework'
const stringData: any = { table1: [{ col1: 'first col value' }] }
export const computeTests = (adapter: SASjs): TestSuite => ({
name: 'Compute',
tests: [
{
title: 'Compute API request',
description: 'Should run the request with compute API approach',
test: async () => {
return await adapter.request('common/sendArr', stringData)
},
assertion: (response: any) => {
return response.table1[0][0] === stringData.table1[0].col1
}
},
{
title: 'JES API request',
description: 'Should run the request with JES API approach',
test: async () => {
const config = {
useComputeApi: false
}
return await adapter.request('common/sendArr', stringData, config)
},
assertion: (response: any) => {
return response.table1[0][0] === stringData.table1[0].col1
}
},
{
title: 'Start Compute Job - not waiting for result',
description: 'Should start a compute job and return the session',