@@ -2,7 +2,7 @@ import { expect } from 'chai';
2
2
import {
3
3
messagesToLines ,
4
4
truncateLines ,
5
- linesToMergedStr ,
5
+ joinLines ,
6
6
} from '../../browser/serial/monitor/monitor-utils' ;
7
7
import { Line } from '../../browser/serial/monitor/serial-monitor-send-output' ;
8
8
import { set , reset } from 'mockdate' ;
@@ -16,15 +16,15 @@ type TestLine = {
16
16
charCount : number ;
17
17
maxCharacters ?: number ;
18
18
} ;
19
- expectedMerged ?: string ;
19
+ expectedJoined ?: string ;
20
20
} ;
21
21
22
22
const date = new Date ( ) ;
23
23
const testLines : TestLine [ ] = [
24
24
{
25
25
messages : [ 'Hello' ] ,
26
26
expected : { lines : [ { message : 'Hello' , lineLen : 5 } ] , charCount : 5 } ,
27
- expectedMerged : 'Hello' ,
27
+ expectedJoined : 'Hello' ,
28
28
} ,
29
29
{
30
30
messages : [ 'Hello' , 'Dog!' ] ,
@@ -39,7 +39,7 @@ const testLines: TestLine[] = [
39
39
] ,
40
40
charCount : 10 ,
41
41
} ,
42
- expectedMerged : 'Hello\nDog!'
42
+ expectedJoined : 'Hello\nDog!'
43
43
} ,
44
44
{
45
45
messages : [ 'Dog!' ] ,
@@ -71,7 +71,7 @@ const testLines: TestLine[] = [
71
71
{ message : "You're a good boy!" , lineLen : 8 } ,
72
72
] ,
73
73
} ,
74
- expectedMerged : "Hello Dog!\n Who's a good boy?\nYou're a good boy!" ,
74
+ expectedJoined : "Hello Dog!\n Who's a good boy?\nYou're a good boy!" ,
75
75
} ,
76
76
{
77
77
messages : [ 'boy?\n' , "You're a good boy!" ] ,
@@ -121,7 +121,7 @@ const testLines: TestLine[] = [
121
121
{ message : 'Yo' , lineLen : 2 } ,
122
122
] ,
123
123
} ,
124
- expectedMerged : "Hello Dog!\nWho's a good boy?\nYo" ,
124
+ expectedJoined : "Hello Dog!\nWho's a good boy?\nYo" ,
125
125
} ,
126
126
] ;
127
127
@@ -171,9 +171,9 @@ describe('Monitor Utils', () => {
171
171
} ) ;
172
172
expect ( totalCharCount ) . to . equal ( charCount ) ;
173
173
}
174
- if ( testLine . expectedMerged ) {
175
- const merged_str = linesToMergedStr ( testLine . expected . lines ) ;
176
- expect ( merged_str ) . to . equal ( testLine . expectedMerged ) ;
174
+ if ( testLine . expectedJoined ) {
175
+ const joined_str = joinLines ( testLine . expected . lines ) ;
176
+ expect ( joined_str ) . to . equal ( testLine . expectedJoined ) ;
177
177
}
178
178
} ) ;
179
179
} ) ;
0 commit comments