Skip to content

Commit 2750797

Browse files
authored
fix: Specify typescript version (#22)
1 parent b61e1b5 commit 2750797

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
"dependencies": {
4848
"lodash": "^4.17.4",
4949
"tslib": "^1.7.1",
50-
"typescript": "^2.4.1"
50+
"typescript": "2.4.2"
5151
}
5252
}

test/TypescriptParser.spec.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,15 +675,15 @@ describe('TypescriptParser', () => {
675675

676676
expect(parsed).toMatchSnapshot();
677677
});
678-
678+
679679
it('should parse a simple javascript file correctly with "parseFiles"', async () => {
680680
const parsed = await parser.parseFiles([file], rootPath);
681681
delete parsed[0].filePath;
682682
delete (parsed[0] as any).rootPath;
683683

684684
expect(parsed).toMatchSnapshot();
685685
});
686-
686+
687687
it('should parse a simple javascript file correctly with "parseSource"', async () => {
688688
const content = readFileSync(file).toString();
689689
const parsed = await parser.parseSource(content);
@@ -704,15 +704,15 @@ describe('TypescriptParser', () => {
704704

705705
expect(parsed).toMatchSnapshot();
706706
});
707-
707+
708708
it('should parse a simple javascript react file correctly with "parseFiles"', async () => {
709709
const parsed = await parser.parseFiles([file], rootPath);
710710
delete parsed[0].filePath;
711711
delete (parsed[0] as any).rootPath;
712712

713713
expect(parsed).toMatchSnapshot();
714714
});
715-
715+
716716
it('should parse a simple javascript react file correctly with "parseSource"', async () => {
717717
const content = readFileSync(file).toString();
718718
const parsed = await parser.parseSource(content);
@@ -722,4 +722,17 @@ describe('TypescriptParser', () => {
722722

723723
});
724724

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+
725738
});

0 commit comments

Comments
 (0)