Skip to content

Commit c9de802

Browse files
committed
fix(StringUtil): make stringDivider function cut at actual given length
BREAKING CHANGE: The stringDivider function now breaks at given length and not at given length + 1.
1 parent bf22eb4 commit c9de802

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/StringUtil/StringUtil.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ describe('StringUtil', () => {
7777
});
7878

7979
it('splits hard on the width length and wraps the string into given format if its length' +
80-
'is greater then the provided line width', () => {
81-
const inputString = 'MyLengthIsGreaterThen20';
80+
'is greater than the provided line width', () => {
81+
const inputString = 'MyLengthIsGreaterThan20';
8282
const width = 10;
8383
const spaceReplacer = '\n';
8484
const outputString = StringUtil.stringDivider(inputString, width, spaceReplacer);
85-
const expectedString = 'MyLengthIs-\nGreaterThe-\nn20';
85+
const expectedString = 'MyLengthIs-\nGreaterTha-\nn20';
8686
expect(outputString).toBe(expectedString);
8787
});
8888

89-
it('splits on whitespace and wraps the string into given format if its length is greater then' +
89+
it('splits on whitespace and wraps the string into given format if its length is greater than' +
9090
'the provided line width', () => {
9191
const inputString = 'I should be split on whitespace';
9292
const width = 11;

0 commit comments

Comments
 (0)