1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-05 03:30:05 +00:00

chore(*): add more test cases

This commit is contained in:
Krishna Acondy
2021-05-06 13:21:49 +01:00
parent a32c0879b3
commit 5543f467e6

View File

@@ -24,4 +24,20 @@ describe('convertToCsv', () => {
expect(convertToCSV(data)).toEqual(expectedOutput)
})
it('should convert values with mixed quotes', () => {
const data = [{ foo: `'blah'`, bar: `"blah"` }]
const expectedOutput = `foo:$6. bar:$6.\r\n"'blah'","""blah"""`
expect(convertToCSV(data)).toEqual(expectedOutput)
})
it('should convert values with mixed quotes', () => {
const data = [{ foo: `'blah,"'`, bar: `"blah,blah" "` }]
const expectedOutput = `foo:$8. bar:$13.\r\n"'blah,""'","""blah,blah"" """`
expect(convertToCSV(data)).toEqual(expectedOutput)
})
})