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

Convert common/lib files to Typescript and Jest #37640

Merged
merged 8 commits into from
Jun 17, 2019

Conversation

crob611
Copy link
Contributor

@crob611 crob611 commented May 31, 2019

Summary

This is the first of probably many PRs to convert from Mocha to Jest tests. Since these were mainly small utilities, I went ahead and converted the files to Typescript as well.

A few of the files here (latest_change, find_in_object) were not being used, so they are being deleted.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@crob611 crob611 requested a review from a team as a code owner May 31, 2019 11:06
@crob611 crob611 added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas review labels May 31, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@crob611 crob611 added v8.0.0 v7.3.0 chore loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes labels May 31, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

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

Nice work.

* @field Name of the column that we are looking for the type of
* @returns The column type or the string 'null'
*/
export function getFieldType(columns: DatatableColumn[], field?: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add return type. It's only inferred at the moment to be string.

>(
rows: RowType[],
columns?: string[]
): { [s in ReturnColumns]: s extends keyof RowType ? Array<RowType[s]> : undefined[] } {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: make s a whole word variable: why not column? And do we expect an array of undefineds? I think you want never.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@crob611 crob611 merged commit 6b3ffb8 into elastic:master Jun 17, 2019
crob611 pushed a commit to crob611/kibana that referenced this pull request Jul 1, 2019
* Remove unused lib and associated tests

* Convert unquote string to TS and Jest

* Convert getFieldType to TS and Jest

* Convert httpurl to TS and Jest

* Remove latest_change and tests

* Convert pivot_object_array to TS and Jest

* Address PR feedback
crob611 pushed a commit that referenced this pull request Jul 1, 2019
* Convert common/lib files to Typescript and Jest  (#37640)

* Remove unused lib and associated tests

* Convert unquote string to TS and Jest

* Convert getFieldType to TS and Jest

* Convert httpurl to TS and Jest

* Remove latest_change and tests

* Convert pivot_object_array to TS and Jest

* Address PR feedback

* Fix type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.3.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants