Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
medjedovicm committed Aug 5, 2021
1 parent ea80d27 commit ddb1d50
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
36 changes: 18 additions & 18 deletions src/utils/executor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { getExecutorPath } from './executor'

// Add more pair options to be tested here
const serverTypePathMap: {serverType: string, executorPath: string}[] = [
{serverType: 'SASVIYA', executorPath: '/SASJobExecution'},
{serverType: 'SAS9', executorPath: '/SASStoredProcess/do'}
const serverTypePathMap: { serverType: string; executorPath: string }[] = [
{ serverType: 'SASVIYA', executorPath: '/SASJobExecution' },
{ serverType: 'SAS9', executorPath: '/SASStoredProcess/do' }
]

describe('Get executor path', () => {
it('should return the path based on server type', () => {
for (let entry of serverTypePathMap) {
expect(getExecutorPath(entry.serverType)).toEqual(entry.executorPath)
}
})
it('should return the path based on server type', () => {
for (let entry of serverTypePathMap) {
expect(getExecutorPath(entry.serverType)).toEqual(entry.executorPath)
}
})

it('should return the path based on server type provided lowercase', () => {
for (let entry of serverTypePathMap) {
expect(getExecutorPath(entry.serverType)).toEqual(entry.executorPath)
}
})
it('should return the path based on server type provided lowercase', () => {
for (let entry of serverTypePathMap) {
expect(getExecutorPath(entry.serverType)).toEqual(entry.executorPath)
}
})

it('should return empty string for incorrectly provided server type', () => {
expect(getExecutorPath('invalid')).toEqual('')
expect(getExecutorPath('')).toEqual('')
})
})
it('should return empty string for incorrectly provided server type', () => {
expect(getExecutorPath('invalid')).toEqual('')
expect(getExecutorPath('')).toEqual('')
})
})
14 changes: 7 additions & 7 deletions src/utils/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

//Add more options here
const executorPathMap: ExecutorPathMap = {
SASVIYA: '/SASJobExecution',
SAS9: '/SASStoredProcess/do'
SASVIYA: '/SASJobExecution',
SAS9: '/SASStoredProcess/do'
}

export const getExecutorPath = (serverType: string) => {
if (!serverType) return ''
if (!serverType) return ''

serverType = serverType.toUpperCase()
serverType = serverType.toUpperCase()

return executorPathMap[serverType] || ''
return executorPathMap[serverType] || ''
}

interface ExecutorPathMap {
[key: string]: string
}
[key: string]: string
}

0 comments on commit ddb1d50

Please sign in to comment.