Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('String formatter', () => {
expect(getStringsFromCommaSeparatedList('first,second, third ')).toEqual(
expect.arrayContaining(['first', 'second', 'third'])
);
expect(getStringsFromCommaSeparatedList('first,second, ')).toEqual(expect.arrayContaining(['first', 'second']));
expect(getStringsFromCommaSeparatedList('first')).toEqual(expect.arrayContaining(['first']));
expect(getStringsFromCommaSeparatedList('first,second, ')).toEqual(['first', 'second']);
expect(getStringsFromCommaSeparatedList('first')).toEqual(['first']);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const collapseWhitespace = (str: string): string =>

export const getStringsFromCommaSeparatedList = (text: string): string[] =>
text
.trim()
.split(',')
.map(part => part.trim())
.filter(part => part !== '');