Skip to content

Commit

Permalink
feat: remove enzyme support (#72)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: enzyme adapter and serializer must now be configured independently if needed
  • Loading branch information
smackfu authored and JAdshead committed Feb 17, 2024
1 parent fc1657f commit 24ed427
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1,537 deletions.
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+.
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

0 comments on commit 24ed427

Please sign in to comment.