Skip to content

Refine package exports to fix Jest 28 out of box compatibility #1975

@riovir

Description

@riovir

Currently, @vue/test-utils doesn't work with Jest v28 + JSDOM out of the box, requiring the following workaround to prevent trying to read the browser export where CJS is expected:

jest.config.js

moduleNameMapper: {
	'^@vue/test-utils$': require.resolve('@vue/test-utils'),
},

Cleanup

What should be cleaned up or changed:
Refine the package.json exports declarations for the browser to offer the ESM and CJS editions in case of import and require being used. To do so would allow the package to work out of the box with Jest v28 + jest-environment-jsdom

Provide any links for context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions