mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-07 12:30:06 +00:00
chore(git): Merge branch 'fixing-sas9-tests' into auto-tests
This commit is contained in:
@@ -47,7 +47,9 @@ export const basicTests = (
|
|||||||
'Should fail on first attempt and should log the user in on second attempt',
|
'Should fail on first attempt and should log the user in on second attempt',
|
||||||
test: async () => {
|
test: async () => {
|
||||||
await adapter.logOut()
|
await adapter.logOut()
|
||||||
|
await sleep(1000)
|
||||||
await adapter.logIn('invalid', 'invalid')
|
await adapter.logIn('invalid', 'invalid')
|
||||||
|
await sleep(1000)
|
||||||
return adapter.logIn(userName, password)
|
return adapter.logIn(userName, password)
|
||||||
},
|
},
|
||||||
assertion: (response: any) =>
|
assertion: (response: any) =>
|
||||||
@@ -162,3 +164,7 @@ export const basicTests = (
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const sleep = (ms: number) => {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||||
|
}
|
||||||
|
|||||||
@@ -112,20 +112,9 @@ export class WebJobExecutor extends BaseJobExecutor {
|
|||||||
this.appendRequest(res, sasJob, config.debug)
|
this.appendRequest(res, sasJob, config.debug)
|
||||||
resolve(jsonResponse)
|
resolve(jsonResponse)
|
||||||
}
|
}
|
||||||
if (this.serverType === ServerType.Sas9 && config.debug) {
|
|
||||||
const jsonResponse = parseWeboutResponse(res.result as string)
|
|
||||||
if (jsonResponse === '') {
|
|
||||||
throw new Error(
|
|
||||||
'Valid JSON could not be extracted from response.'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
getValidJson(jsonResponse)
|
|
||||||
this.appendRequest(res, sasJob, config.debug)
|
this.appendRequest(res, sasJob, config.debug)
|
||||||
resolve(res.result)
|
|
||||||
}
|
|
||||||
getValidJson(res.result as string)
|
getValidJson(res.result as string)
|
||||||
this.appendRequest(res, sasJob, config.debug)
|
|
||||||
resolve(res.result)
|
resolve(res.result)
|
||||||
})
|
})
|
||||||
.catch(async (e: Error) => {
|
.catch(async (e: Error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user