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

function types: optional and vararg arguments. #650

Merged
merged 2 commits into from
Nov 11, 2017
Merged

Conversation

mprobst
Copy link
Contributor

@mprobst mprobst commented Nov 10, 2017

No description provided.

@@ -6,7 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/

import {expect} from 'chai';
import {expect, use as chaiUse} from 'chai';
// tslint:disable-next-line:no-require-imports chai-diff needs a CommonJS import.
Copy link
Contributor

Choose a reason for hiding this comment

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

How come? You can
import * as chaiDiff from 'chai-diff';
and then use it as a function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a wontfix TypeScript issue about it:
microsoft/TypeScript#5073

@@ -35,6 +35,7 @@
"@types/source-map": "^0.5.1",
"@types/source-map-support": "^0.2.27",
"chai": "^3.5.0",
"chai-diff": "^1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is good, but FWIW in my experience it's easier to just let the thing write out new goldens and examine the output with 'git diff'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I'm interactively tweaking the emit, I find it much easier to see a good diff there than re-gen the goldens. That also runs a high risk of missing a change. But I understand workflows are different.

@mprobst mprobst force-pushed the optional-arg branch 2 times, most recently from 20ca325 to 44fc351 Compare November 10, 2017 17:09
Previously, this would dump two long strings including escaped newlines
and quotes, which made it ~impossible to tell the difference.
Previously, tsickle would support optional and varag arguments in
function declarations (`@param` tags etc), but not in pure function
types.
@mprobst mprobst merged commit b09b0e8 into master Nov 11, 2017
@mprobst mprobst deleted the optional-arg branch November 11, 2017 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants