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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,9 @@ Extends [amex-jest-preset](https://github.com/americanexpress/amex-jest-preset)

- [moduleNameMapper](http://facebook.github.io/jest/docs/en/configuration.html#modulenamemapper-object-string-string) tells Jest to treat CSS modules as identity objects

- [setupFilesAfterEnv](https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array) is where we setup [enzyme with enzyme-adapter-react-16](http://airbnb.io/enzyme/docs/installation/react-16.html)

- [snapshotSerializers](http://facebook.github.io/jest/docs/en/configuration.html#snapshotserializers-array-string) tells Jest to use [enzyme-to-json's](https://github.com/adriantoine/enzyme-to-json) serializer

### 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.

This package is compatible only with React 17+.

## 🗝️ License

Expand Down
3 changes: 0 additions & 3 deletions __tests__/__snapshots__/jest-preset.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ exports[`a jest configuration is exported 1`] = `
".npm",
],
"setupFilesAfterEnv": Any<Array>,
"snapshotSerializers": [
"enzyme-to-json/serializer",
],
"testEnvironment": "jsdom",
"testResultsProcessor": Any<String>,
}
Expand Down
1 change: 0 additions & 1 deletion jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const basePreset = require('amex-jest-preset');
const reactSpecificPreset = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: [require.resolve('./jest-setup')],
snapshotSerializers: ['enzyme-to-json/serializer'],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy'
},
Expand Down
5 changes: 0 additions & 5 deletions jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ require('whatwg-fetch');
global.requestAnimationFrame = (callback) => {
setTimeout(callback, 0);
};

const Enzyme = require('enzyme');
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17');

Enzyme.configure({ adapter: new Adapter() });
Loading
Loading