@@ -159,13 +159,9 @@ const valid = [
159159 filename : 'my-component.gjs' ,
160160 code : `
161161 const Foo = <template>hi</template>;
162- const Bar = 'x';
162+
163163 <template>
164- <Foo as |Abc Xyz|>
165- <Abc.x />
166- {{Xyz.x}}
167- </Foo>
168- <Bar.x />
164+ <Foo />
169165 </template>
170166 ` ,
171167 } ,
@@ -727,7 +723,8 @@ describe('multiple tokens in same file', () => {
727723 severity : 2 ,
728724 } ) ;
729725 } ) ;
730- it ( 'correctly maps duplicate <template> tokens to the correct lines' , async ( ) => {
726+
727+ it ( 'correctly maps tokens after handlebars' , async ( ) => {
731728 const eslint = initESLint ( ) ;
732729 const code = `
733730 import Component from '@glimmer/component';
@@ -741,7 +738,8 @@ describe('multiple tokens in same file', () => {
741738 super(...arguments);
742739 }
743740
744- foo = 'bar';
741+ foo = bar;
742+
745743 <template>
746744 <div>
747745 some totally random, non-meaningful text {{bar}}
@@ -752,11 +750,15 @@ describe('multiple tokens in same file', () => {
752750 const results = await eslint . lintText ( code , { filePath : 'my-component.gjs' } ) ;
753751
754752 const resultErrors = results . flatMap ( ( result ) => result . messages ) ;
755- expect ( resultErrors ) . toHaveLength ( 2 ) ;
753+ expect ( resultErrors ) . toHaveLength ( 3 ) ;
756754 expect ( resultErrors [ 0 ] . message ) . toBe ( "'foo' is not defined." ) ;
757755 expect ( resultErrors [ 0 ] . line ) . toBe ( 5 ) ;
758756
759757 expect ( resultErrors [ 1 ] . message ) . toBe ( "'bar' is not defined." ) ;
760- expect ( resultErrors [ 1 ] . line ) . toBe ( 16 ) ;
758+ expect ( resultErrors [ 1 ] . endLine ) . toBe ( 13 ) ;
759+ expect ( resultErrors [ 1 ] . line ) . toBe ( 13 ) ;
760+
761+ expect ( resultErrors [ 2 ] . message ) . toBe ( "'bar' is not defined." ) ;
762+ expect ( resultErrors [ 2 ] . line ) . toBe ( 17 ) ;
761763 } ) ;
762764} ) ;
0 commit comments