@@ -2,7 +2,7 @@ import { expect } from 'chai';
22import {
33 messagesToLines ,
44 truncateLines ,
5- linesToMergedStr ,
5+ joinLines ,
66} from '../../browser/serial/monitor/monitor-utils' ;
77import { Line } from '../../browser/serial/monitor/serial-monitor-send-output' ;
88import { set , reset } from 'mockdate' ;
@@ -16,15 +16,15 @@ type TestLine = {
1616 charCount : number ;
1717 maxCharacters ?: number ;
1818 } ;
19- expectedMerged ?: string ;
19+ expectedJoined ?: string ;
2020} ;
2121
2222const date = new Date ( ) ;
2323const testLines : TestLine [ ] = [
2424 {
2525 messages : [ 'Hello' ] ,
2626 expected : { lines : [ { message : 'Hello' , lineLen : 5 } ] , charCount : 5 } ,
27- expectedMerged : 'Hello' ,
27+ expectedJoined : 'Hello' ,
2828 } ,
2929 {
3030 messages : [ 'Hello' , 'Dog!' ] ,
@@ -39,7 +39,7 @@ const testLines: TestLine[] = [
3939 ] ,
4040 charCount : 10 ,
4141 } ,
42- expectedMerged : 'Hello\nDog!'
42+ expectedJoined : 'Hello\nDog!'
4343 } ,
4444 {
4545 messages : [ 'Dog!' ] ,
@@ -71,7 +71,7 @@ const testLines: TestLine[] = [
7171 { message : "You're a good boy!" , lineLen : 8 } ,
7272 ] ,
7373 } ,
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!" ,
7575 } ,
7676 {
7777 messages : [ 'boy?\n' , "You're a good boy!" ] ,
@@ -121,7 +121,7 @@ const testLines: TestLine[] = [
121121 { message : 'Yo' , lineLen : 2 } ,
122122 ] ,
123123 } ,
124- expectedMerged : "Hello Dog!\nWho's a good boy?\nYo" ,
124+ expectedJoined : "Hello Dog!\nWho's a good boy?\nYo" ,
125125 } ,
126126] ;
127127
@@ -171,9 +171,9 @@ describe('Monitor Utils', () => {
171171 } ) ;
172172 expect ( totalCharCount ) . to . equal ( charCount ) ;
173173 }
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 ) ;
177177 }
178178 } ) ;
179179 } ) ;
0 commit comments