Skip to content

fix: Specify typescript version #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.only('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);
});

});

});