-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat: Closure compile, golden file base tests. #1
Conversation
Golden files are easier to author, and easier to check for correctness with Closure compiler. This also formulates tests in terms of the final Closure style output, not the intermediate annotated TypeScript program.
@@ -73,7 +73,7 @@ gulp.task('test.unit', ['test.compile'], function(done) { | |||
done(); | |||
return; | |||
} | |||
return gulp.src('build/test/**/*.js').pipe(mocha({timeout: 500})); | |||
return gulp.src('build/test/**/*.js').pipe(mocha({timeout: 5000})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closure :-(
9e8ba20
to
28d0148
Compare
Friendly Ping @rkirov :-) |
Golden files are easier to author, and easier to check for correctness with Closure compiler. This also formulates tests in terms of the final Closure style output, not the intermediate annotated TypeScript program.
The E2E tests running Closure are substantially slower and mostly serve as only a sanity check.
... which apparently runs on rather slow machines.
Previously the test driver didn't pass the proper ES6 compiler options, which caused the output to be down-transpiled, but also our standard-library caching not to work.
}); | ||
|
||
gulp.task('test', ['test.unit', 'test.check-format']); | ||
gulp.task('test.e2e', ['test.compile'], function(done) { | ||
if (hasError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting pattern, there has to be a better way to compose errors in tasks :) (no action required)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, gulp has no systematic way to deal with errors, and surprisingly it's still better than all the other tools in that regard...
LGTM. This strategy of goldens works pretty well for clutz, so it is nice to have it here too. |
- Cleaner determination of min/max param count. - Use ES6 map for unique set of param and type name at each index. - Add missing ctor tags bag for non-overloaded ctor path. - Other minor cleanup.
Imagine code like ``` import 'foo'; // #1 import * as foo from 'foo'; // #2 ``` tsickle currently produces something like: ``` var tsickle_module_1_ = goog.require('foo'); // #1 var foo_1 = tsickle_module_1_; // #2 ``` Using this alias ends up confusing some JSCompiler optimization (see bug). We can avoid it by producing the simpler emit done in this change, which looks instead like: ``` goog.require('foo'); // #1 var foo_1 = goog.require('foo'); // #2 ``` PiperOrigin-RevId: 317391228
Imagine code like ``` import 'foo'; // #1 import * as foo from 'foo'; // #2 ``` tsickle currently produces something like: ``` var tsickle_module_1_ = goog.require('foo'); // #1 var foo_1 = tsickle_module_1_; // #2 ``` Using this alias ends up confusing some JSCompiler optimization (see bug). We can avoid it by producing the simpler emit done in this change, which looks instead like: ``` goog.require('foo'); // #1 var foo_1 = goog.require('foo'); // #2 ``` PiperOrigin-RevId: 317391228
Imagine code like ``` import 'foo'; // #1 import * as foo from 'foo'; // #2 ``` tsickle currently produces something like: ``` var tsickle_module_1_ = goog.require('foo'); // #1 var foo_1 = tsickle_module_1_; // #2 ``` Using this alias ends up confusing some JSCompiler optimization (see bug). We can avoid it by producing the simpler emit done in this change, which looks instead like: ``` goog.require('foo'); // #1 var foo_1 = goog.require('foo'); // #2 ``` PiperOrigin-RevId: 317391228
Imagine code like ``` import 'foo'; // #1 import * as foo from 'foo'; // #2 ``` tsickle currently produces something like: ``` var tsickle_module_1_ = goog.require('foo'); // #1 var foo_1 = tsickle_module_1_; // #2 ``` Using this alias ends up confusing some JSCompiler optimization (see bug). We can avoid it by producing the simpler emit done in this change, which looks instead like: ``` goog.require('foo'); // #1 var foo_1 = goog.require('foo'); // #2 ``` PiperOrigin-RevId: 317957124
Golden files are easier to author, and easier to
check for correctness with Closure compiler.
This also formulates tests in terms of the final
Closure style output, not the intermediate
annotated TypeScript program.