Skip to content

Commit

Permalink
Merge pull request #23 from TypeScript-Heroes/develop
Browse files Browse the repository at this point in the history
Release 2017-09-19
  • Loading branch information
buehler authored Sep 19, 2017
2 parents 15c2b1d + 26cdcf1 commit 10ef4f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"dependencies": {
"lodash": "^4.17.4",
"tslib": "^1.7.1",
"typescript": "^2.4.1"
"typescript": "2.4.2"
}
}
21 changes: 17 additions & 4 deletions test/TypescriptParser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,15 +675,15 @@ 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;
delete (parsed[0] as any).rootPath;

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);
Expand All @@ -704,15 +704,15 @@ 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;
delete (parsed[0] as any).rootPath;

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);
Expand All @@ -722,4 +722,17 @@ describe('TypescriptParser', () => {

});

describe('Specific sources', () => {

it('should parse generics in functions in classes correctly', async () => {
const parsed = await parser.parseSource(`export class TestClass {
public test() {
let a = <T>() => { let b = null; };
}
}`);
console.log(parsed);
});

});

});

0 comments on commit 10ef4f7

Please sign in to comment.