Skip to content
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

Add test suite for DefinitelyTyped #22

Merged
merged 5 commits into from
Aug 1, 2017

Conversation

fstoerkle
Copy link
Contributor

@fstoerkle fstoerkle commented Jul 31, 2017

As suggested in #20, this adds a new test suite for testing the compilation of all type definitions in DefinitelyTyped, in the same way as flow-typed is currently tested.

The implementation is pretty much the same as for flow-typed, some code is even duplicated.
Please let me know if you want me to refactor/clean that up, or if you are fine with it as is for now.

Note: A test run for compiling all DefinitelyTyped types (currently 7744!) takes a while (~ 10 minute on my MacBook)

For the output from node docs/find-error.js see below:

29  StringLiteral is not currently supported
19  Unknown type when converting to Bucklescript type
17  Type parameter bounds is not currently supported
17  Unknown statement type when parsing libdef
11  Intersection types is not currently supported
10  NumberLiteral is not currently supported
10  BooleanLiteral is not currently supported
9  Unknown declaration when converting a module property declaration
9 SYNTAX ERROR
8  static CallProperty on Object types is not currently supported
7  Indexer on Object types is not currently supported
6  Unknown declaration type when converting a module declaration
4  Typeof can only operate on variable declarations
4  Built-in type $Subtype is not currently supported
2  Inheriting in interfaces is not currently supported
2  Built-in type $Exports is not currently supported
2  Type parameter variance is not currently supported
1  Built-in type $npm$dropzone$FilesToString is not currently supported
1  Built-in type $npm$currencyFormatter$Currency is not currently supported
1  Built-in type $npm$MersenneTwister is not currently supported
1  Built-in type $npm$pad$options is not currently supported
1  Unknown identifier
1  Built-in type $npm$parse$Parse is not currently supported
1  Built-in type $npm$color$RGBObject is not currently supported
1  Built-in type $npm$styledComponents$Interpolation is not currently supported

@rrdelaney
Copy link
Owner

Thanks so much, this looks great! Ignore the CircleCI build failing for now, that's my fault (broken cache).

I can't test this right now, but I'll pull later tonight and check out the results from the test runs

Thanks again 😄 this is great to test against even more libraries

@rrdelaney rrdelaney self-requested a review August 1, 2017 05:16
Copy link
Owner

@rrdelaney rrdelaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran prettier against your branch 🙂 Not official repo guidelines, but I should add them 😅

@rrdelaney rrdelaney merged commit bfb13e0 into rrdelaney:master Aug 1, 2017
@rrdelaney
Copy link
Owner

I updated the find-error.js script to get test results from DT, so many errors haha!

2190 SYNTAX ERROR
1542  undefined
1076  Unknown identifier
500  Unknown declaration when converting a module property declaration 
340  Typeof can only operate on variable declarations
316  typeof can only operate on classes
267  Intersection types is not currently supported 
41  StringLiteral is not currently supported 
34  Indexer on Object types is not currently supported 
20  Unknown type when converting to Bucklescript type 
17  Unknown statement type when parsing libdef 
17  Type parameter bounds is not currently supported 
16  NumberLiteral is not currently supported 
10  BooleanLiteral is not currently supported 
8  static CallProperty on Object types is not currently supported 
6  Unknown declaration type when converting a module declaration 
4  Built-in type $Subtype is not currently supported 
4  Promise must have exactly one type parameter. Found none.
3  Non-string as object property should not happen 
3 TypeError: Cannot read property '1' of undefined
2  Inheriting in interfaces is not currently supported 
2  Type parameter variance is not currently supported 
2  Built-in type $Exports is not currently supported 
1  Array with more than one type is not currently supported 
1  Built-in type $npm$dropzone$FilesToString is not currently supported 
1  Built-in type $npm$currencyFormatter$Currency is not currently supported 
1  Built-in type $npm$MersenneTwister is not currently supported 
1  Built-in type $npm$pad$options is not currently supported 
1  Built-in type $npm$color$RGBObject is not currently supported 
1  Built-in type $npm$parse$Parse is not currently supported 
1 TypeError: Cannot read property 'text' of undefined
1  Built-in type $script is not currently supported 
1 RangeError: Maximum call stack size exceeded
1 TypeError: Cannot read property 'c' of undefined
1  Built-in type $npm$styledComponents$Interpolation is not currently supported 

@fstoerkle fstoerkle deleted the definitely-typed-tests branch August 1, 2017 08:44
@fstoerkle
Copy link
Contributor Author

Nice! 🎉

Yes, there are indeed a lot of errors ;)

One note: I think you ran prettier also over the git submodule src/__tests__/definitely-typed. Was that intended? I guess it will make updating the submodule complicated, since you have local changes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
CLI
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants