@@ -228,7 +228,7 @@ describe('SerializeAddon', () => {
228228 it ( 'empty terminal with selection turned off' , ( ) => {
229229 const output = serializeAddon . serializeAsHTML ( ) ;
230230 assert . notEqual ( output , '' ) ;
231- assert . equal ( ( output . match ( / < d i v > < s p a n > { 10 } < \/ s p a n > < \/ d i v > / g) || [ ] ) . length , 2 ) ;
231+ assert . equal ( ( output . match ( / < d i v > < s p a n > { 10 } < \/ s p a n > < \/ d i v > / g) ?? [ ] ) . length , 2 ) ;
232232 } ) ;
233233
234234 it ( 'empty terminal with no selection' , ( ) => {
@@ -245,7 +245,7 @@ describe('SerializeAddon', () => {
245245 const output = serializeAddon . serializeAsHTML ( {
246246 onlySelection : true
247247 } ) ;
248- assert . equal ( ( output . match ( / < d i v > < s p a n > t e r m i n a l < \/ s p a n > < \/ d i v > / g) || [ ] ) . length , 1 , output ) ;
248+ assert . equal ( ( output . match ( / < d i v > < s p a n > t e r m i n a l < \/ s p a n > < \/ d i v > / g) ?? [ ] ) . length , 1 , output ) ;
249249 } ) ;
250250
251251 it ( 'basic terminal with html unsafe chars' , async ( ) => {
@@ -255,7 +255,7 @@ describe('SerializeAddon', () => {
255255 const output = serializeAddon . serializeAsHTML ( {
256256 onlySelection : true
257257 } ) ;
258- assert . equal ( ( output . match ( / < d i v > < s p a n > & l t ; a > & a m p ; p i ; < \/ s p a n > < \/ d i v > / g) || [ ] ) . length , 1 , output ) ;
258+ assert . equal ( ( output . match ( / < d i v > < s p a n > & l t ; a > & a m p ; p i ; < \/ s p a n > < \/ d i v > / g) ?? [ ] ) . length , 1 , output ) ;
259259 } ) ;
260260
261261 it ( 'serializes rows within a provided range' , async ( ) => {
@@ -267,7 +267,7 @@ describe('SerializeAddon', () => {
267267 startCol : 4
268268 }
269269 } ) ;
270- const rowMatches = output . match ( / < d i v > < s p a n > .* ?< \/ s p a n > < \/ d i v > / g) || [ ] ;
270+ const rowMatches = output . match ( / < d i v > < s p a n > .* ?< \/ s p a n > < \/ d i v > / g) ?? [ ] ;
271271 assert . equal ( rowMatches . length , 1 , output ) ;
272272 assert . ok ( rowMatches [ 0 ] ?. includes ( 'hello' ) ) ;
273273 assert . ok ( ! output . includes ( 'bye' ) ) ;
@@ -278,56 +278,56 @@ describe('SerializeAddon', () => {
278278 await writeP ( terminal , ' ' + sgr ( '1' ) + 'terminal' + sgr ( '22' ) + ' ' ) ;
279279
280280 const output = serializeAddon . serializeAsHTML ( ) ;
281- assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - w e i g h t : b o l d ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
281+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - w e i g h t : b o l d ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
282282 } ) ;
283283
284284 it ( 'cells with italic styling' , async ( ) => {
285285 await writeP ( terminal , ' ' + sgr ( '3' ) + 'terminal' + sgr ( '23' ) + ' ' ) ;
286286
287287 const output = serializeAddon . serializeAsHTML ( ) ;
288- assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - s t y l e : i t a l i c ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
288+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - s t y l e : i t a l i c ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
289289 } ) ;
290290
291291 it ( 'cells with inverse styling' , async ( ) => {
292292 await writeP ( terminal , ' ' + sgr ( '7' ) + 'terminal' + sgr ( '27' ) + ' ' ) ;
293293
294294 const output = serializeAddon . serializeAsHTML ( ) ;
295- assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # 0 0 0 0 0 0 ; b a c k g r o u n d - c o l o r : # B F B F B F ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
295+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # 0 0 0 0 0 0 ; b a c k g r o u n d - c o l o r : # B F B F B F ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
296296 } ) ;
297297
298298 it ( 'cells with underline styling' , async ( ) => {
299299 await writeP ( terminal , ' ' + sgr ( '4' ) + 'terminal' + sgr ( '24' ) + ' ' ) ;
300300
301301 const output = serializeAddon . serializeAsHTML ( ) ;
302- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
302+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
303303 } ) ;
304304
305305 it ( 'cells with double underline styling' , async ( ) => {
306306 await writeP ( terminal , ' ' + sgr ( '4:2' ) + 'terminal' + sgr ( '24' ) + ' ' ) ;
307307
308308 const output = serializeAddon . serializeAsHTML ( ) ;
309- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e d o u b l e ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
309+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e d o u b l e ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
310310 } ) ;
311311
312312 it ( 'cells with curly underline styling' , async ( ) => {
313313 await writeP ( terminal , ' ' + sgr ( '4:3' ) + 'terminal' + sgr ( '24' ) + ' ' ) ;
314314
315315 const output = serializeAddon . serializeAsHTML ( ) ;
316- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e w a v y ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
316+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e w a v y ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
317317 } ) ;
318318
319319 it ( 'cells with dotted underline styling' , async ( ) => {
320320 await writeP ( terminal , ' ' + sgr ( '4:4' ) + 'terminal' + sgr ( '24' ) + ' ' ) ;
321321
322322 const output = serializeAddon . serializeAsHTML ( ) ;
323- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e d o t t e d ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
323+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e d o t t e d ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
324324 } ) ;
325325
326326 it ( 'cells with dashed underline styling' , async ( ) => {
327327 await writeP ( terminal , ' ' + sgr ( '4:5' ) + 'terminal' + sgr ( '24' ) + ' ' ) ;
328328
329329 const output = serializeAddon . serializeAsHTML ( ) ;
330- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e d a s h e d ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
330+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : u n d e r l i n e d a s h e d ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
331331 } ) ;
332332
333333 it ( 'cells with underline color (palette)' , async ( ) => {
@@ -350,49 +350,49 @@ describe('SerializeAddon', () => {
350350 await writeP ( terminal , ' ' + sgr ( '8' ) + 'terminal' + sgr ( '28' ) + ' ' ) ;
351351
352352 const output = serializeAddon . serializeAsHTML ( ) ;
353- assert . equal ( ( output . match ( / < s p a n s t y l e = ' v i s i b i l i t y : h i d d e n ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
353+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' v i s i b i l i t y : h i d d e n ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
354354 } ) ;
355355
356356 it ( 'cells with dim styling' , async ( ) => {
357357 await writeP ( terminal , ' ' + sgr ( '2' ) + 'terminal' + sgr ( '22' ) + ' ' ) ;
358358
359359 const output = serializeAddon . serializeAsHTML ( ) ;
360- assert . equal ( ( output . match ( / < s p a n s t y l e = ' o p a c i t y : 0 .5 ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
360+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' o p a c i t y : 0 .5 ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
361361 } ) ;
362362
363363 it ( 'cells with strikethrough styling' , async ( ) => {
364364 await writeP ( terminal , ' ' + sgr ( '9' ) + 'terminal' + sgr ( '29' ) + ' ' ) ;
365365
366366 const output = serializeAddon . serializeAsHTML ( ) ;
367- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : l i n e - t h r o u g h ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
367+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : l i n e - t h r o u g h ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
368368 } ) ;
369369
370370 it ( 'cells with combined styling' , async ( ) => {
371371 await writeP ( terminal , sgr ( '1' ) + ' ' + sgr ( '9' ) + 'termi' + sgr ( '22' ) + 'nal' + sgr ( '29' ) + ' ' ) ;
372372
373373 const output = serializeAddon . serializeAsHTML ( ) ;
374- assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - w e i g h t : b o l d ; ' > < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
375- assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - w e i g h t : b o l d ; t e x t - d e c o r a t i o n : l i n e - t h r o u g h ; ' > t e r m i < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
376- assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : l i n e - t h r o u g h ; ' > n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
374+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - w e i g h t : b o l d ; ' > < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
375+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' f o n t - w e i g h t : b o l d ; t e x t - d e c o r a t i o n : l i n e - t h r o u g h ; ' > t e r m i < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
376+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' t e x t - d e c o r a t i o n : l i n e - t h r o u g h ; ' > n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
377377 } ) ;
378378
379379 it ( 'cells with color styling' , async ( ) => {
380380 await writeP ( terminal , ' ' + sgr ( '38;5;46' ) + 'terminal' + sgr ( '39' ) + ' ' ) ;
381381
382382 const output = serializeAddon . serializeAsHTML ( ) ;
383- assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # 0 0 f f 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
383+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # 0 0 f f 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
384384 } ) ;
385385
386386 it ( 'cells with background styling' , async ( ) => {
387387 await writeP ( terminal , ' ' + sgr ( '48;5;46' ) + 'terminal' + sgr ( '49' ) + ' ' ) ;
388388
389389 const output = serializeAddon . serializeAsHTML ( ) ;
390- assert . equal ( ( output . match ( / < s p a n s t y l e = ' b a c k g r o u n d - c o l o r : # 0 0 f f 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
390+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' b a c k g r o u n d - c o l o r : # 0 0 f f 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
391391 } ) ;
392392
393393 it ( 'empty terminal with default options' , async ( ) => {
394394 const output = serializeAddon . serializeAsHTML ( ) ;
395- assert . equal ( ( output . match ( / c o l o r : # 0 0 0 0 0 0 ; b a c k g r o u n d - c o l o r : # f f f f f f ; f o n t - f a m i l y : m o n o s p a c e ; f o n t - s i z e : 1 5 p x ; / g) || [ ] ) . length , 1 , output ) ;
395+ assert . equal ( ( output . match ( / c o l o r : # 0 0 0 0 0 0 ; b a c k g r o u n d - c o l o r : # f f f f f f ; f o n t - f a m i l y : m o n o s p a c e ; f o n t - s i z e : 1 5 p x ; / g) ?? [ ] ) . length , 1 , output ) ;
396396 } ) ;
397397
398398 it ( 'empty terminal with custom options' , async ( ) => {
@@ -405,14 +405,14 @@ describe('SerializeAddon', () => {
405405 const output = serializeAddon . serializeAsHTML ( {
406406 includeGlobalBackground : true
407407 } ) ;
408- assert . equal ( ( output . match ( / c o l o r : # f f 0 0 f f ; b a c k g r o u n d - c o l o r : # 0 0 f f 0 0 ; f o n t - f a m i l y : v e r d a n a ; f o n t - s i z e : 2 0 p x ; / g) || [ ] ) . length , 1 , output ) ;
408+ assert . equal ( ( output . match ( / c o l o r : # f f 0 0 f f ; b a c k g r o u n d - c o l o r : # 0 0 f f 0 0 ; f o n t - f a m i l y : v e r d a n a ; f o n t - s i z e : 2 0 p x ; / g) ?? [ ] ) . length , 1 , output ) ;
409409 } ) ;
410410
411411 it ( 'empty terminal with background included' , async ( ) => {
412412 const output = serializeAddon . serializeAsHTML ( {
413413 includeGlobalBackground : true
414414 } ) ;
415- assert . equal ( ( output . match ( / c o l o r : # f f f f f f ; b a c k g r o u n d - c o l o r : # 0 0 0 0 0 0 ; f o n t - f a m i l y : m o n o s p a c e ; f o n t - s i z e : 1 5 p x ; / g) || [ ] ) . length , 1 , output ) ;
415+ assert . equal ( ( output . match ( / c o l o r : # f f f f f f ; b a c k g r o u n d - c o l o r : # 0 0 0 0 0 0 ; f o n t - f a m i l y : m o n o s p a c e ; f o n t - s i z e : 1 5 p x ; / g) ?? [ ] ) . length , 1 , output ) ;
416416 } ) ;
417417
418418 it ( 'cells with custom color styling' , async ( ) => {
@@ -422,7 +422,7 @@ describe('SerializeAddon', () => {
422422 await writeP ( terminal , ' ' + sgr ( '38;5;0' ) + 'terminal' + sgr ( '39' ) + ' ' ) ;
423423
424424 const output = serializeAddon . serializeAsHTML ( ) ;
425- assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # f f a 5 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
425+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # f f a 5 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
426426 } ) ;
427427
428428 it ( 'cells with color styling - xterm headless' , async ( ) => {
@@ -432,7 +432,7 @@ describe('SerializeAddon', () => {
432432 await writeP ( terminal , ' ' + sgr ( '38;5;46' ) + 'terminal' + sgr ( '39' ) + ' ' ) ;
433433
434434 const output = serializeAddon . serializeAsHTML ( ) ;
435- assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # 0 0 f f 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) || [ ] ) . length , 1 , output ) ;
435+ assert . equal ( ( output . match ( / < s p a n s t y l e = ' c o l o r : # 0 0 f f 0 0 ; ' > t e r m i n a l < \/ s p a n > / g) ?? [ ] ) . length , 1 , output ) ;
436436 } ) ;
437437 } ) ;
438438} ) ;
0 commit comments