Skip to content

fix(validators): support components returning render function from setup (fix #1596) #1600

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

Merged
merged 1 commit into from
Aug 30, 2020

Conversation

LeBenLeBen
Copy link
Contributor

@LeBenLeBen LeBenLeBen commented Jul 1, 2020

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

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

  • Yes
  • No

The PR fulfills these requirements:

@lmiller1990 lmiller1990 self-requested a review July 4, 2020 00:26
@lmiller1990
Copy link
Member

Any chance to add a test for this?

@LeBenLeBen
Copy link
Contributor Author

@lmiller1990 I was expecting this 😅 I didn't add tests because I didn't find any existing tests related to this method nor validators in general in the code base. I’m not sure where these should be added, could you guide me a bit?

@lmiller1990
Copy link
Member

lmiller1990 commented Jul 12, 2020

Sure thing, just stick in here: https://github.com/vuejs/vue-test-utils/blob/dev/test/specs/mount.spec.js. This codebase avoids testing implementation details (good thing) and just tests things however the user would be do it (usually with mount).

There is already a test using the composition API plugin, you could copy and paste that one. Just make a component with a setup function that returns a render function and assert wrapper.html() contains whatever the render function returns.

We are in the process of moving to Jest, but until then you need to build bundle each time you change anything in packages. So add you test, and run yarn build && yarn test:unit:only to see if it passes.

@LeBenLeBen
Copy link
Contributor Author

@lmiller1990 Thanks for the guidance, hope that fulfill your expectations, otherwise let me know!

@lmiller1990
Copy link
Member

@LeBenLeBen if you have some time can you try merging the latest dev to your branch?

We moved to jest, it should make it easier to fix the CI and get this merged. Sorry I didn't get back to you - I thought I had pinged you, I guess not.

Can you merge in dev and push again? Everything should be green then and we can merge.

@LeBenLeBen
Copy link
Contributor Author

@lmiller1990 Done!

@LeBenLeBen
Copy link
Contributor Author

I’m not sure why it doesn’t work with Vue 2.5… I tried to update @vue/composition-api to the latest stable but it didn’t fix it, moving to the 1.0 beta introduce other issues and I’m not sure you want to go this way.

It seems that the oldest version supported is Vue 2.5.22. Does the compat test use the latest 2.5 patch or 2.5.0 ?

@lmiller1990
Copy link
Member

If you are having trouble with an older failing just add a conditional to skip it, see here for an example:

vueVersion < 2.3,

Pretty keen to get this merged.

@LeBenLeBen
Copy link
Contributor Author

@lmiller1990 🚀

@lmiller1990 lmiller1990 merged commit 6e3e4e5 into vuejs:dev Aug 30, 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.

Components only returning a render function from setup aren't considered components
2 participants