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

feat: enable sugar ref take 2 for vue3-jest #377

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

cexbrayat
Copy link
Member

This PR allows testing components using sugar ref take 2 vuejs/rfcs#369

Note that I did not make it configurable for now, but maybe it should be. Opinions?

@lmiller1990
Copy link
Member

Nice. What do you mean by configurable? If you aren't using the ref sugar, you won't be impacted by this update, right?

@cexbrayat
Copy link
Member Author

I think you won't be impacted (we could merge and release an alpha to make sure of it on our projects).

The probable edge case is someone naming its own variables $ref or another reserved sugar syntax... In that case, vue-jest will transform them and probably error, whereas vue-next will not unless explicitly told? I'm not 100% sure, as I'm not using sugar ref in my own projects.

@lmiller1990
Copy link
Member

It seems really unlikely someone named their variable $ref, so I think this is fine.

@lmiller1990 lmiller1990 merged commit a7f4e66 into vuejs:master Sep 6, 2021
@sibbng
Copy link

sibbng commented Oct 25, 2021

Ref take 2 also includes helpers like $() and $$() which can be conflict with https://github.com/antfu/v-dollar or any function named as or aliased to $ like:

import { unref as $ } from 'vue'

I don't think people do that more often than using new ref syntax with script setup, but it would be weird to make people disable new ref transform on jest config whilst they didn't enable it on their app.

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.

3 participants