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: remove enzyme support #72

Merged
merged 1 commit into from
Feb 16, 2024
Merged

feat: remove enzyme support #72

merged 1 commit into from
Feb 16, 2024

Conversation

smackfu
Copy link
Member

@smackfu smackfu commented Feb 5, 2024

BREAKING CHANGE: enzyme adapter and serializer must now be configured independently if needed

Description

Remove the enzyme dependency and configuration.

Motivation and Context

enzyme is not supported in React 18.
https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl

It's also no longer considered good testing practice vs something like react-testing-library.

The enzyme dependency and configuration in this preset makes it hard to move completely away from enzyme.

(I don't think this can be moved to an optional peer dep because of the references to enzyme in the jest config.)

How Has This Been Tested?

Installed in a package that otherwise doesn't use enzyme and verified that unit tests still pass and does not bring in the dependency.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • My changes are in sync with the code style of this project.
  • There aren't any other open Pull Requests for the same issue/update.
  • These changes should be applied to a maintenance branch.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using amex-jest-preset-react?

Upgrading to the new version would require manually configuration enzyme if it is still being used.

BREAKING CHANGE: enzyme adapter and serializer must now be configured independently if needed
### Compatibility

This package is compatible only with React 16+.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually changed with the last major version which switched to the enzyme 17 adapter.

@smackfu
Copy link
Member Author

smackfu commented Feb 7, 2024

Closing since it seems like the preference is to use the react-18 adapter despite it's limitations.
https://www.npmjs.com/package/@cfaester/enzyme-adapter-react-18

@smackfu smackfu closed this Feb 7, 2024
@JAdshead JAdshead reopened this Feb 16, 2024
@JAdshead JAdshead changed the base branch from main to next February 16, 2024 20:55
@JAdshead
Copy link
Contributor

Reopening as the inclusion of the enzyme adapter was a stop gap. Support will only drift further apart.

@JAdshead JAdshead merged commit 75d9c82 into next Feb 16, 2024
7 checks passed
@JAdshead JAdshead deleted the remove-enzyme branch February 16, 2024 20:56
JAdshead pushed a commit that referenced this pull request Feb 17, 2024
BREAKING CHANGE: enzyme adapter and serializer must now be configured independently if needed
oneamexbot added a commit that referenced this pull request Feb 17, 2024
# [9.0.0](v8.1.0...v9.0.0) (2024-02-17)

### chore

* **node:** drop node 16 support ([2ec5125](2ec5125))

### Features

* **peer-deps:** allow react 18 ([db79ec5](db79ec5))
* remove enzyme support ([#72](#72)) ([24ed427](24ed427))

### BREAKING CHANGES

* **node:** drop node 16 support
* enzyme adapter and serializer must now be configured independently if needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants