This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
feat: Closure compile, golden file base tests. #1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Merged
}); | ||
|
||
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. |
hess-g
added a commit
to hess-g/tsickle
that referenced
this pull request
Sep 22, 2016
- 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.
copybara-service bot
pushed a commit
that referenced
this pull request
Jun 23, 2020
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
copybara-service bot
pushed a commit
that referenced
this pull request
Jun 23, 2020
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
copybara-service bot
pushed a commit
that referenced
this pull request
Jun 23, 2020
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
copybara-service bot
pushed a commit
that referenced
this pull request
Jun 23, 2020
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.