Skip to content

[@storybook/test] Move @testing-library/dom to a peerDependency #27532

@shilman

Description

@shilman

Discussed in #27501

Originally posted by MatanBobi June 1, 2024

Is your feature request related to a problem? Please describe.

In React Testing Library, we've experienced multiple issues that occur once people install dom-testing-library on their own (as part of user-event for example) and also install a library that bundles DTL (like @storybook/test and also @testing-library/react). These issues occur once there's a version mismatch and multiple version of DTL get installed.

Describe the solution you'd like

Moving DTL to a peerDependency will help with solving this issue.

Describe alternatives you've considered

No response

Are you able to assist to bring the feature to reality?

yes, I can

Additional context

I'm a member of the testing-library organization and due to multiple issues we had with multiple version of DTL installed, we've decided to create a PR to move DTL to a peerDependency in React-Testing-Library:
testing-library/react-testing-library#1305

This is something we've thought about for quite a long time and we highly recommend other libraries in the testing-library ecosystem to also do.
I'm here and available to assist in any issues that occur or even contribute this change on my own.
Feel free to reach out to me or any of us from the testing-library organization.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions