The Wayback Machine - https://web.archive.org/web/20201212155834/https://github.com/vuejs/vue-test-utils/pull/1427
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 kahirokunn requested review from ktsn and lmiller1990 Feb 4, 2020
@kahirokunn
Copy link
Contributor Author

@kahirokunn kahirokunn commented Feb 4, 2020

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

@lmiller1990
Copy link
Member

@lmiller1990 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

@kahirokunn kahirokunn commented Feb 4, 2020

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 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

@kahirokunn kahirokunn commented Feb 10, 2020

Thank you!

@lmiller1990
Copy link
Member

@lmiller1990 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
6 checks passed
6 checks passed
ci/circleci: bootstrap Your tests passed on CircleCI!
Details
ci/circleci: build_test Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test_compat Your tests passed on CircleCI!
Details
deploy/netlify Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.