1
0
mirror of https://github.com/sasjs/server.git synced 2026-06-09 01:50:22 +00:00

feat: mocking sas9 responses with JS STP

This commit is contained in:
2022-10-17 18:31:08 +02:00
parent 6434123401
commit 36be3a7d5e
7 changed files with 96 additions and 114 deletions
+5 -3
View File
@@ -18,10 +18,12 @@ export const getPreProgramVariables = (req: Request): PreProgramVars => {
if (cookies.length) httpHeaders.push(`cookie: ${cookies.join('; ')}`)
//In desktop mode when mocking mode is enabled, user was undefined.
//So this is workaround.
return {
username: user!.username,
userId: user!.userId,
displayName: user!.displayName,
username: user ? user.username : 'demo',
userId: user ? user.userId : 0,
displayName: user ? user.displayName : 'demo',
serverUrl: protocol + host,
httpHeaders
}
-1
View File
@@ -32,7 +32,6 @@ export const setProcessVariables = async () => {
process.rLoc = process.env.R_PATH
} else {
const { sasLoc, nodeLoc, pythonLoc, rLoc } = await getDesktopFields()
process.sasLoc = sasLoc
process.nodeLoc = nodeLoc
process.pythonLoc = pythonLoc