@@ -675,15 +675,15 @@ describe('TypescriptParser', () => {
675
675
676
676
expect ( parsed ) . toMatchSnapshot ( ) ;
677
677
} ) ;
678
-
678
+
679
679
it ( 'should parse a simple javascript file correctly with "parseFiles"' , async ( ) => {
680
680
const parsed = await parser . parseFiles ( [ file ] , rootPath ) ;
681
681
delete parsed [ 0 ] . filePath ;
682
682
delete ( parsed [ 0 ] as any ) . rootPath ;
683
683
684
684
expect ( parsed ) . toMatchSnapshot ( ) ;
685
685
} ) ;
686
-
686
+
687
687
it ( 'should parse a simple javascript file correctly with "parseSource"' , async ( ) => {
688
688
const content = readFileSync ( file ) . toString ( ) ;
689
689
const parsed = await parser . parseSource ( content ) ;
@@ -704,15 +704,15 @@ describe('TypescriptParser', () => {
704
704
705
705
expect ( parsed ) . toMatchSnapshot ( ) ;
706
706
} ) ;
707
-
707
+
708
708
it ( 'should parse a simple javascript react file correctly with "parseFiles"' , async ( ) => {
709
709
const parsed = await parser . parseFiles ( [ file ] , rootPath ) ;
710
710
delete parsed [ 0 ] . filePath ;
711
711
delete ( parsed [ 0 ] as any ) . rootPath ;
712
712
713
713
expect ( parsed ) . toMatchSnapshot ( ) ;
714
714
} ) ;
715
-
715
+
716
716
it ( 'should parse a simple javascript react file correctly with "parseSource"' , async ( ) => {
717
717
const content = readFileSync ( file ) . toString ( ) ;
718
718
const parsed = await parser . parseSource ( content ) ;
@@ -722,4 +722,17 @@ describe('TypescriptParser', () => {
722
722
723
723
} ) ;
724
724
725
+ describe ( 'Specific sources' , ( ) => {
726
+
727
+ it . only ( 'should parse generics in functions in classes correctly' , async ( ) => {
728
+ const parsed = await parser . parseSource ( `export class TestClass {
729
+ public test() {
730
+ let a = <T>() => { let b = null; };
731
+ }
732
+ }` ) ;
733
+ console . log ( parsed ) ;
734
+ } ) ;
735
+
736
+ } ) ;
737
+
725
738
} ) ;
0 commit comments