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

fix: #1426 #1427

Merged
merged 1 commit into from Feb 10, 2020
Merged

fix: #1426 #1427

merged 1 commit into from Feb 10, 2020

Conversation

kahirokunn
Copy link
Contributor

@kahirokunn kahirokunn commented Feb 4, 2020

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Closes #1426

@kahirokunn
Copy link
Contributor Author

@lmiller1990 よろしくおねがいします!

@lmiller1990
Copy link
Member

lmiller1990 commented Feb 4, 2020

This is just typing for the props definitions, right? Can you give an example of what this actually does (eg does this give better VSCode suggestions?)

@kahirokunn
Copy link
Contributor Author

I wrote the test code like this.
https://gist.github.com/kahirokunn/a15c911cbad33082afb41cc861524c2d

I got the error in there

const wrapper = shallowMount(functionalComponent, { localVue, propsData: { tag: 'p' } })

because functionalComponent type is not FunctionalComponentOptions<Record<any, any>>
my functionalComponent type is FunctionalComponentOptions<{ tag: string }>
FunctionalComponentOptions approve to inject Generics.
so I fixed vue test utils type definition.

@lmiller1990
Copy link
Member

lmiller1990 commented Feb 4, 2020

Right, makes sense. Seems fine to me. Will give it a try and merge this up tomorrow.

@kahirokunn
Copy link
Contributor Author

Thank you!

@lmiller1990
Copy link
Member

lmiller1990 commented Feb 10, 2020

Forgot about this... it looks fine, let's merge it up. I am not sure when this will be released - probably during Feb sometime.

VTU for V3 will be much more TS friendly - I might ask for your help with some of the definitions 🤔

@lmiller1990 lmiller1990 merged commit ebcf97c into vuejs:dev Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot write the type safe functional component test case.
2 participants