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

Jest 27 support #6602

Closed
cexbrayat opened this issue Jul 24, 2021 · 2 comments · Fixed by #6627
Closed

Jest 27 support #6602

cexbrayat opened this issue Jul 24, 2021 · 2 comments · Fixed by #6627
Labels
intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome.

Comments

@cexbrayat
Copy link
Member

What problem does this feature solve?

The cli-plugin-unit-jest currently relies on jest v26, with vue-jest v5 for Vue 3 and v4 for Vue 2.
ts-jest v26 is used as well for TS projects.

A new package called vue3-jest has been introduced by the testing team to support Vue 3, with a versioning similar to what babel-jest and ts-jest do. An alpha release is available to support Jest v27 (vue3-jest@27.0.0-alpha.2 currently, see vuejs/vue-jest#343).

Even with this package, it's currently difficult to update to Jest v27, as the the plugin depends on jest 26 explicitly.
See vuejs/vue-jest#343 (comment) for a workaround using Yarn resolutions.

What does the proposed API look like?

The idea would be to:

  • use vue3-jest@27 for Vue 3 (template and presets)
  • make jest an explicit dependency of Vue projects, as it has been done for ts-jest and vue-jest, allowing to update the Jest version to v27
  • bump babel-jest and ts-jest to v27 in the generated template

If that sounds good, I can try to work an PR, to hopefully land this in CLI v5

@sodatea
Copy link
Member

sodatea commented Jul 27, 2021

That would be cool!

Though, we need Jest 27 support for Vue 2, too, so that the generating logic could be simpler.

@cexbrayat
Copy link
Member Author

@sodatea yeah I realized that, so I worked on a PR to land support for Vue 2 as well (vuejs/vue-jest#368)

@sodatea sodatea added the intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome. label Jul 29, 2021
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Aug 8, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- vue3-jest as a transformer for Vue 3 projects
- vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
@cexbrayat cexbrayat mentioned this issue Aug 8, 2021
9 tasks
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Aug 8, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- vue3-jest as a transformer for Vue 3 projects
- vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Aug 30, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- vue3-jest as a transformer for Vue 3 projects
- vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Aug 30, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- vue3-jest as a transformer for Vue 3 projects
- vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Aug 30, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- vue3-jest as a transformer for Vue 3 projects
- vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Sep 9, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- @vue/vue3-jest as a transformer for Vue 3 projects
- @vue/vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Sep 9, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- @vue/vue3-jest as a transformer for Vue 3 projects
- @vue/vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
cexbrayat added a commit to cexbrayat/vue-cli that referenced this issue Sep 9, 2021
Fixes vuejs#6602

This commit updates the generated project to use:
- jest v27, as an explicit dependency
- ts-jest and babel-jest v27
- @vue/vue3-jest as a transformer for Vue 3 projects
- @vue/vue2-jest as a transformer for Vue 2 projects

The default Babel transformer has been updated to work with Jest v27 as well.
FRSgit added a commit to FRSOURCE/tiny-carousel that referenced this issue Sep 13, 2021
migrate jest to 27 (for all packages except vue, see vuejs/vue-cli#6602)
FRSgit added a commit to FRSOURCE/tiny-carousel that referenced this issue Sep 13, 2021
migrate jest to 27 (for all packages except vue, see vuejs/vue-cli#6602)
FRSgit pushed a commit to FRSOURCE/tiny-carousel that referenced this issue Sep 13, 2021
migrate jest to 27 (for all packages except vue, see vuejs/vue-cli#6602)
remove dead lint rule
dead lint rule removal due to 429 responses from gh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intend to implement The team has the intention to implement this feature at some point. Contribution is also welcome.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants