aboutsummaryrefslogtreecommitdiffstats
path: root/test/jsUtils.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/jsUtils.test.ts')
-rw-r--r--test/jsUtils.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/jsUtils.test.ts b/test/jsUtils.test.ts
index 138158611..0662c3c48 100644
--- a/test/jsUtils.test.ts
+++ b/test/jsUtils.test.ts
@@ -151,4 +151,20 @@ describe('jsUtils', () => {
151 expect(jsUtils.acceleratorString(11, 'abc')).toEqual(''); 151 expect(jsUtils.acceleratorString(11, 'abc')).toEqual('');
152 }); 152 });
153 }); 153 });
154
155 describe('removeNewLines', () => {
156 it('handles unix style new lines', () => {
157 expect(jsUtils.removeNewLines('abc def\nghi')).toEqual('abc defghi');
158 });
159
160 it('handles windows style new lines', () => {
161 expect(jsUtils.removeNewLines('abc def\r\nghi')).toEqual('abc defghi');
162 });
163
164 it('handles new lines in the beginning, middle and ending of the string', () => {
165 expect(jsUtils.removeNewLines('\nabc def\r\nghi\n')).toEqual(
166 'abc defghi',
167 );
168 });
169 });
154}); 170});