Skip to content

Commit

Permalink
Change flattenJSONObject to return POSIX compliant names
Browse files Browse the repository at this point in the history
Closes #20
  • Loading branch information
cbui authored and abhilash1in committed Jul 24, 2021
1 parent 68d18fb commit fe7c2d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5,685 deletions.
6 changes: 3 additions & 3 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test('Get Secret Value Map: parse=false, plain-text value', () => {
test('Get Secret Value Map: parse=true, JSON string value', () => {
expect.assertions(1)
return getSecretValueMap(secretsManagerClient, 'my_secret_2', true).then(secretValueMap => {
expect(secretValueMap).toMatchObject({ 'my_secret_2.foo': 'bar' })
expect(secretValueMap).toMatchObject({ 'my_secret_2_foo': 'bar' })
})
})

Expand All @@ -73,7 +73,7 @@ test('Get Secret Value Map: parse=false, JSON string value', () => {
test('Get Secret Value Map: parse=true, Base64 encoded JSON string value', () => {
expect.assertions(1)
return getSecretValueMap(secretsManagerClient, 'my/secret/3', true).then(secretValueMap => {
expect(secretValueMap).toMatchObject({ 'my/secret/3.foo': 'bar' })
expect(secretValueMap).toMatchObject({ 'my/secret/3_foo': 'bar' })
})
})

Expand All @@ -96,4 +96,4 @@ test('Get Secret Names To Fetch: Multiple Wild Card Names', () => {
return getSecretNamesToFetch(secretsManagerClient, ['my*', 'my_secret*', 'invalidfoobarbaz']).then(secretNames => {
expect(secretNames.sort()).toEqual(['my_secret_1', 'my_secret_2', 'my/secret/3'].sort())
})
})
})
2 changes: 1 addition & 1 deletion __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('Valid JSON object', () => {
})

test('Valid JSON object string test', () => {
expect(flattenJSONObject({"foo": {"bar": "baz"}})).toMatchObject({"foo.bar": "baz"})
expect(flattenJSONObject({"foo": {"bar": "baz"}})).toMatchObject({"foo_bar": "baz"})
})

test('FilterBy test', () => {
Expand Down
Loading

0 comments on commit fe7c2d0

Please sign in to comment.