Skip to content

Jest 27 support #6602

Closed
Closed
@cexbrayat

Description

@cexbrayat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    intend to implementThe team has the intention to implement this feature at some point. Contribution is also welcome.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions