@@ -1485,7 +1485,7 @@ describe('type check blocks', () => {
14851485 ` ;
14861486
14871487 const result = tcb ( TEMPLATE ) ;
1488- expect ( result ) . toContain ( 'for (const item of ((this).items)) { var _t1 = item;' ) ;
1488+ expect ( result ) . toContain ( 'for (const item of ((this).items)! ) { var _t1 = item;' ) ;
14891489 expect ( result ) . toContain ( '"" + ((this).main(_t1))' ) ;
14901490 expect ( result ) . toContain ( '"" + ((this).empty())' ) ;
14911491 } ) ;
@@ -1498,7 +1498,7 @@ describe('type check blocks', () => {
14981498 ` ;
14991499
15001500 const result = tcb ( TEMPLATE ) ;
1501- expect ( result ) . toContain ( 'for (const item of ((this).items)) { var _t1 = item;' ) ;
1501+ expect ( result ) . toContain ( 'for (const item of ((this).items)! ) { var _t1 = item;' ) ;
15021502 expect ( result ) . toContain ( 'var _t2: number = null!;' ) ;
15031503 expect ( result ) . toContain ( 'var _t3: number = null!;' ) ;
15041504 expect ( result ) . toContain ( 'var _t4: number = null!;' ) ;
@@ -1516,7 +1516,7 @@ describe('type check blocks', () => {
15161516 ` ;
15171517
15181518 const result = tcb ( TEMPLATE ) ;
1519- expect ( result ) . toContain ( 'for (const item of ((this).items)) { var _t1 = item;' ) ;
1519+ expect ( result ) . toContain ( 'for (const item of ((this).items)! ) { var _t1 = item;' ) ;
15201520 expect ( result ) . toContain ( 'var _t2: number = null!;' ) ;
15211521 expect ( result ) . toContain ( 'var _t3: number = null!;' ) ;
15221522 expect ( result ) . toContain ( 'var _t4: number = null!;' ) ;
@@ -1532,7 +1532,7 @@ describe('type check blocks', () => {
15321532 ` ;
15331533
15341534 const result = tcb ( TEMPLATE ) ;
1535- expect ( result ) . toContain ( 'for (const item of ((this).items)) { var _t1 = item;' ) ;
1535+ expect ( result ) . toContain ( 'for (const item of ((this).items)! ) { var _t1 = item;' ) ;
15361536 expect ( result ) . toContain ( 'var _t2: number = null!;' ) ;
15371537 expect ( result ) . toContain ( '"" + (((this).$index)) + (_t2)' ) ;
15381538 } ) ;
@@ -1550,18 +1550,18 @@ describe('type check blocks', () => {
15501550
15511551 const result = tcb ( TEMPLATE ) ;
15521552 expect ( result ) . toContain (
1553- 'for (const item of ((this).items)) { var _t1 = item; var _t2: number = null!;' ) ;
1553+ 'for (const item of ((this).items)! ) { var _t1 = item; var _t2: number = null!;' ) ;
15541554 expect ( result ) . toContain ( '"" + (_t1) + (_t2)' ) ;
15551555 expect ( result ) . toContain (
1556- 'for (const inner of ((_t1).items)) { var _t8 = inner; var _t9: number = null!;' ) ;
1556+ 'for (const inner of ((_t1).items)! ) { var _t8 = inner; var _t9: number = null!;' ) ;
15571557 expect ( result ) . toContain ( '"" + (_t1) + (_t2) + (_t8) + (_t9)' ) ;
15581558 } ) ;
15591559
15601560 it ( 'should generate the tracking expression of a for loop' , ( ) => {
15611561 const result = tcb ( `@for (item of items; track trackingFn($index, item, prop)) {}` ) ;
15621562
15631563 expect ( result ) . toContain (
1564- 'for (const item of ((this).items)) { var _t1: number = null!; var _t2 = item;' ) ;
1564+ 'for (const item of ((this).items)! ) { var _t1: number = null!; var _t2 = item;' ) ;
15651565 expect ( result ) . toContain ( '(this).trackingFn(_t1, _t2, ((this).prop));' ) ;
15661566 } ) ;
15671567 } ) ;
0 commit comments