diff --git a/package.json b/package.json index 537312b..60e8836 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "dependencies": { "lodash": "^4.17.4", "tslib": "^1.7.1", - "typescript": "^2.4.1" + "typescript": "2.4.2" } } diff --git a/test/TypescriptParser.spec.ts b/test/TypescriptParser.spec.ts index 0b17459..b2ea796 100644 --- a/test/TypescriptParser.spec.ts +++ b/test/TypescriptParser.spec.ts @@ -675,7 +675,7 @@ describe('TypescriptParser', () => { expect(parsed).toMatchSnapshot(); }); - + it('should parse a simple javascript file correctly with "parseFiles"', async () => { const parsed = await parser.parseFiles([file], rootPath); delete parsed[0].filePath; @@ -683,7 +683,7 @@ describe('TypescriptParser', () => { expect(parsed).toMatchSnapshot(); }); - + it('should parse a simple javascript file correctly with "parseSource"', async () => { const content = readFileSync(file).toString(); const parsed = await parser.parseSource(content); @@ -704,7 +704,7 @@ describe('TypescriptParser', () => { expect(parsed).toMatchSnapshot(); }); - + it('should parse a simple javascript react file correctly with "parseFiles"', async () => { const parsed = await parser.parseFiles([file], rootPath); delete parsed[0].filePath; @@ -712,7 +712,7 @@ describe('TypescriptParser', () => { expect(parsed).toMatchSnapshot(); }); - + it('should parse a simple javascript react file correctly with "parseSource"', async () => { const content = readFileSync(file).toString(); const parsed = await parser.parseSource(content); @@ -722,4 +722,17 @@ describe('TypescriptParser', () => { }); + describe('Specific sources', () => { + + it.only('should parse generics in functions in classes correctly', async () => { + const parsed = await parser.parseSource(`export class TestClass { + public test() { + let a = () => { let b = null; }; + } + }`); + console.log(parsed); + }); + + }); + });