Skip to content

Commit a4dc90c

Browse files
committed
(fix) adding tests for parameter map
1 parent c31f5b5 commit a4dc90c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

__tests__/utils.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ describe('Parse Parameters', () => {
5656
])
5757
})
5858

59+
test('returns parameters list from string', async () => {
60+
const json = parseParameters(
61+
'MyParam1=myValue1,MyParam2=myValue2,MyParam2=myValue3'
62+
)
63+
expect(json).toEqual([
64+
{
65+
ParameterKey: 'MyParam1',
66+
ParameterValue: 'myValue1'
67+
},
68+
{
69+
ParameterKey: 'MyParam2',
70+
ParameterValue: 'myValue2,myValue3'
71+
}
72+
])
73+
})
74+
5975
test('returns parameters list from file', async () => {
6076
const filename = 'file://' + path.join(__dirname, 'params.test.json')
6177
const json = parseParameters(filename)

src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function parseParameters(parameterOverrides: string): Parameter[] {
4747
throw err
4848
}
4949
}
50+
5051
const parameters = new Map<string, string>()
5152
parameterOverrides.split(',').forEach(parameter => {
5253
const [key, value] = parameter.trim().split('=')

0 commit comments

Comments
 (0)