feat(medusa): CSV formatter accounts for comma and semicolon (#2789)

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
Adrien de Peretti
2022-12-15 14:06:49 +01:00
committed by GitHub
co-authored by Sebastian Rindom
parent 2d22b17b49
commit 0fa5042e35
3 changed files with 24 additions and 5 deletions
@@ -7,11 +7,27 @@ type Case = {
const cases: [string, Case][] = [
[
"should return the exact input when there is no new line char",
"should return a the exact input content",
{
str: "Hello my name is Adrien and I like writing single line content.",
expected:
'Hello my name is Adrien and I like writing single line content.',
},
],
[
"should return a formatted string escaping the coma",
{
str: "Hello, my name is Adrien and I like writing single line content.",
expected:
"Hello, my name is Adrien and I like writing single line content.",
'"Hello, my name is Adrien and I like writing single line content."',
},
],
[
"should return a formatted string escaping the semicolon",
{
str: "Hello; my name is Adrien and I like writing single line content.",
expected:
'"Hello; my name is Adrien and I like writing single line content."',
},
],
[