Skip to content

Commit e5bbc05

Browse files
committed
[O2B-1503] Added test for splitStringToStringsTrimmed()
1 parent 8e82b34 commit e5bbc05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/lib/utilities/stringUtils.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313

14-
const { snakeToCamel, pascalToSnake, ucFirst, lcFirst, snakeToPascal } = require('../../../lib/utilities/stringUtils.js');
14+
const { snakeToCamel, pascalToSnake, ucFirst, lcFirst, snakeToPascal, splitStringToStringsTrimmed } = require('../../../lib/utilities/stringUtils.js');
1515
const { expect } = require('chai');
1616

1717
module.exports = () => {
@@ -61,6 +61,11 @@ module.exports = () => {
6161
expect(snakeToCamel('SNAKE')).to.equal('snake');
6262
});
6363

64+
it('should successfully split string into array of strings', () => {
65+
expect(splitStringToStringsTrimmed('one , two, three ')).to.deep.equal(['one', 'two', 'three']);
66+
expect(splitStringToStringsTrimmed('one . two. three ', '.')).to.deep.equal(['one', 'two', 'three']);
67+
});
68+
6469
it('should successfully convert snake_case string to PascalCase', () => {
6570
expect(snakeToPascal('this_is_snake_case')).to.equal('ThisIsSnakeCase');
6671
expect(snakeToPascal('_this_is_snake_case')).to.equal('ThisIsSnakeCase');

0 commit comments

Comments
 (0)